One Signal setup not match with current firebase dependencies - flutter

I try to prepare my flutter app to work with one signal plugin , but when follow the steps that defined by one signal itself , there are many error related to version of dependancies appear I upgrade them but the problem is still exist and not clear for me
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> In project 'android' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[1
0.2.1, 16.0.99]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.onesignal:OneSignal:3.15.6 -> com.google.android.gms:play-services-location#[10.2.1, 16.0.99], b
ut play-services-location version was 17.1.0.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'android' depends on project 'geolocator' which depends onto com.google.android.gms:play-services-location#16
.0.0
-- Project 'android' depends on project 'app' which depends onto com.onesignal:OneSignal#[3.15.6, 3.99.99]
-- Project 'android' depends on project 'app' which depends onto com.onesignal:OneSignal#{strictly 3.15.6}
-- Project 'android' depends on project 'onesignal_flutter' which depends onto com.onesignal:OneSignal#3.15.6
-- Project 'android' depends on project 'app' which depends onto com.google.android.gms:play-services-location#17.1.0
-- Project 'android' depends on project 'app' which depends onto com.google.android.gms:play-services-location#{strictly
17.1.0}
-- Project 'android' depends on project 'location' which depends onto com.google.android.gms:play-services-location#16.+
For extended debugging info execute Gradle from the command line with ./gradlew --info :android:assembleDebug to see the
dependency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at http
s://github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = true }" to you
r build.gradle file.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ```

May be this issue arise because your project not match with this version of library ,
Try to use this way(default version)
onesignal_flutter:
Not this way
onesignal_flutter: ^2.6.2

Related

* What went wrong: A problem occurred evaluating project ':app'. > org/bouncycastle/operator/OperatorCreationException

In Every flutter build, even in a fresh one, I'm getting the same error1
lib/main.dart:1
FAILURE: Build failed with an exception.
* Where:
Build file '/home/aabirsark/Desktop/projects/rx_converter/android/app/build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> org/bouncycastle/operator/OperatorCreationException
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 28s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Pls help me with this... I'm really stuck with it and can't make more progress pls help!!!
6 Steps:
click on Project Structure (folder with 3 dot icon next to Stop icon).
Project Structure --> Project Settings --> Project
under Project SDK: Select Android API 30 Platform
click Apply --> OK
click on Project Structure (folder with 3 dot icon next to Stop icon).
Project Structure --> Project Settings --> Modules
click + icon --> Apply --> OK
Use latest Gradle
Set the JDK version to Embedded JDK
For MAC:
Android Studio > Preferences... > Build, Execution, Deployment > Build Tools > Gradle Under Gradle JDK
choose the Embedded JDK option. Click OK.
For windows:
select File > Settings... > Build, Execution, Deployment > Build Tools > Gradle Under Gradle JDK
choose the Embedded JDK option.
--add-opens If you have to allow code on the class path to do deep reflection to access nonpublic members, then use the --add-opens runtime option.
Some libraries do deep reflection, meaning setAccessible(true), so they can access all members, including private ones. You can grant this access using the --add-opens option on the java command line. No warning messages are generated as a result of using this option.
If --illegal-access=deny, and you see IllegalAccessException or InaccessibleObjectException messages at runtime, you could use the --add-opens runtime option, basing the arguments upon the information shown in the exception message.
config jvm option Since version 9, the Java compiler can be configured to produce bytecode for an older Java version while making sure the code does not use any APIs from a more recent version. Gradle now supports this release flag on CompileOptions directly for Java compilation. This option takes precedence over the properties described below.
Due to a bug in Java 9 that was fixed in Java 10, Gradle cannot leverage the release flag when compiling with Java 9.
This should solve..

Flutter - Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'

Today suddenly my app stopped working (can't build anymore), although I was able to build couple hours earlier.
the issue is that OneSignal depends on some google services which come back as forbidden, this is what I get:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Required by:
project :app > com.google.android.gms:play-services-location:15.0.1
project :app > com.google.android.gms:play-services-places-placereport:15.0.1
> Failed to list versions for com.google.android.gms:play-services-basement.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-basement/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-basement/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-basement/maven-metadata.xml'. Received status code 403 from server: Forbidden
> Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Required by:
project :app > com.google.android.gms:play-services-location:15.0.1
> Failed to list versions for com.google.android.gms:play-services-tasks.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-tasks/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-tasks/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-tasks/maven-metadata.xml'. Received status code 403 from server: Forbidden
I had an issue before when updating flutter itself where I had to use a VPN to be able to update, is this the same thing? I searched Github issues and stack overflow questions but none fixed the issue, also compared this app to others I've built but the implementation is identical (OneSignal wise) and they seem to work fine, what could be the cause of this?
NOTE: I also get this issue even when using a VPN
Thanks for everyone who commented on the question, but I saw these resources before, fortunately though, I was able to fix it by doing the following:
1- Inside build.gradle (app level), I bumped up one signal gradle from
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'
to
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.10'
2- Inside build.gradle (project level), I bumped up gradle from
classpath 'com.android.tools.build:gradle:3.5.0'
to
classpath 'com.android.tools.build:gradle:4.1.3'
3- Inside gradle > wrapper > gradle-wrapper.properties I updated gradle from
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
4- Updated one signal package to version ^2.6.3 instead of ^2.6.1 (I don't think it did something but yeah)

Can't get SHA1 from flutter project because of "The option setting 'android.enableR8=false' is deprecated"

I want to get SHA1 with this comment gradlew signingReport in my android folder. But I can't.
my gradle version is 4.0.2.
I tried to delete the android.enableR8=true from the gradle.propertie file, But nothing changed!
Result of gradlew signingReport --scan
> Configure project :app
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
> Configure project :file_picker
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
FAILURE: Build failed with an exception.
* What went wrong:
Task 'singingReport' not found in root project 'android'. Some candidates are: 'signingReport'.
* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log
output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 55s
Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no] y
Please enter 'yes' or 'no': yes
Gradle Terms of Service accepted.
Publishing build scan...
Result of gradlew singingReport --scan:
Initialized native services in: C:\Users\Ali Azad\.gradle\native
The client will now receive all logging from the daemon (pid: 6348). The daemon log file: C:\Users\Ali Azad\.gradle\daemon\6.1.1\daemon-6348.out.log
Starting 7th build in daemon [uptime: 1 hrs 22 mins 57.548 secs, performance: 99%, GC rate: 0.00/s, heap usage: 9% of 1.1 GB]
Using 2 worker leases.
Starting Build
Settings evaluated using settings file 'D:\projects\Flutter Projects\mobile-app\android\settings.gradle'.
Projects loaded. Root project using build file 'D:\projects\Flutter Projects\mobile-app\android\build.gradle'.
Included projects: [root project 'android', project ':app', project ':file_picker', project ':firebase_auth', project ':firebase_core', project ':flutter_plugin_android_lifecycle', project ':flutter_splash_screen', project ':google_maps_flutter', project ':google_sign_in', project ':image_cropper', project ':image_picker', project ':location', project ':shared_preferences', project ':webview_flutter']
> Configure project :
Evaluating root project 'android' using build file 'D:\projects\Flutter Projects\mobile-app\android\build.gradle'.
> Configure project :app
Evaluating project ':app' using build file 'D:\projects\Flutter Projects\mobile-app\android\app\build.gradle'.
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Creating configuration androidTestUtil
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
> Configure project :file_picker
Evaluating project ':file_picker' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\file_picker-2.0.13\android\build.gradle'.
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Creating configuration androidTestUtil
> Configure project :firebase_auth
Evaluating project ':firebase_auth' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.18.3\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :firebase_core
Evaluating project ':firebase_core' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.2\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :flutter_plugin_android_lifecycle
Evaluating project ':flutter_plugin_android_lifecycle' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-1.0.11\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :flutter_splash_screen
Evaluating project ':flutter_splash_screen' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\flutter_splash_screen-0.1.0\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :google_maps_flutter
Evaluating project ':google_maps_flutter' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-1.0.6\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :google_sign_in
Evaluating project ':google_sign_in' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\google_sign_in-4.5.6\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :image_cropper
Evaluating project ':image_cropper' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\image_cropper-1.3.1\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :image_picker
Evaluating project ':image_picker' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\image_picker-0.6.7+14\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :location
Evaluating project ':location' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\location-2.5.4\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :shared_preferences
Evaluating project ':shared_preferences' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.12+4\android\build.gradle'.
Creating configuration androidTestUtil
> Configure project :webview_flutter
Evaluating project ':webview_flutter' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\webview_flutter-1.0.7\android\build.gradle'.
Creating configuration androidTestUtil
All projects evaluated.
Analytics other plugin to proto: Unknown plugin type FlutterPlugin expected enum FLUTTERPLUGIN
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'singingReport' not found in root project 'android'. Some candidates are: 'signingReport'.
* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 10s
You have a typo in your command. It should be gradlew signingReport not gradlew singingReport.

when i run my flutter app ,there emerge a unexpected problem , error :

What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve project :path_provider_macos.
Required by:
project :app > project :path_provider
Unable to find a matching configuration of project :path_provider_macos: None of the consumable configurations have attributes.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
Some imports are missing. Try flutter pub get to update packages, or flutter pub cache repair, which will re-import all dependencies.
thank everyone , i get the solution about my problem : go to your Flutter sdk folder ,then go to .pub-cache\hosted\pub.dartlang.org\ ,if there have a path_provider_macos-0.0.4 folder ,delete it ,if no ,you try go .pub-cache\hosted\pub.flutter-io.cn\ , and remove path_provider_macos-0.0.4 folder
Deleted the folder you said,but show this wrong : Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_macos.
The following is detailed:
> A problem occurred configuring project ':flutter'.
> Could not resolve all dependencies for configuration ':flutter:embed'.
> Could not resolve project :path_provider_macos.
Required by:
project :flutter
> Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_macos.
> Could not resolve project :path_provider_linux.
Required by:
project :flutter
> Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_linux.

How can I build the OpenIAB unity package using gradle?

I've got problems at building the OpenIAB unity package.
The sdk.dir is already set in the local.properties file.
This is the log:
Denniss-MBP:unity_plugin dennisxxx$ ../gradlew clean buildPlugin --info
Starting Build
Settings evaluated using settings file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/settings.gradle'.
Projects loaded. Root project using build file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/build.gradle'.
Included projects: [root project 'OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62', project ':Unity Plugin', project ':library']
Evaluating root project 'OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62' using build file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/build.gradle'.
Evaluating project ':Unity Plugin' using build file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/unity_plugin/build.gradle'.
Evaluating project ':library' using empty build file.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Unity Plugin'.
> Configuration with name 'default' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 4.414 secs
Denniss-MBP:unity_plugin dennisxxx$
What can I do to fix this issue?