Description:
Your out of date dependencies are giving me issues when building my app.
Target API is 27, you're still using Android Support libraries, instead of AndroidX.
Steps to Reproduce Issue:
@jahirfiquitiva Thanks for pointing this out. We plan to migrate over to AndroidX in the future. Currently there is a dependency on Android Support libraries so projects that have compileSdkVersion on 27 or 26 will still work. Basically we haven't updated to AndroidX in our dependencies as it will break existing projects using OneSignal. Following the steps to use Jetifier will let you use OneSignal even if you have updated your project to AndroidX.
Please follow Google's AndroidX migration guide to use OneSIgnal with AndroidX.
Add the following to your gradle.properties.
android.useAndroidX=true
android.enableJetifier=true
This should resolve any specific issues with OneSignal still using Android Support libraries. If this does not help please let us know the exact errors you are seeing and we can take a look. Thanks.
Unfortunately it is still happening and I can confirm that the dependencies involved are these ones which cannot be resolved by Gradle:
androidx.recyclerview:recyclerview:28.0.0
androidx.appcompat:appcompat:28.0.0
@jkasten2 any updates on this one??
@nilac8991 You're using the wrong dependencies versions. Correct version is 1.0.0 and your issue is not related to the OneSignal SDK.
@jkasten2 's suggestion actually works for the time being, although this change should be a priority for OneSignal SDK.
Hello,
Good to hear it worked. We are definitely keeping this change in mind and will be upgrading as soon as we are able. Thanks for bringing this up. Please let me know if you encounter another related issue.
When do you think you will upgrade? I'm using OneSignal Flutter SDK and it depends on this. It's blocking me to migrate to AndroidX.
@figengungor This shouldn't be a blocker as Google has a tool called Jetifier that will handle the compatibility of libraries still using the Android Support Library instead of AndroidX.
Can you try the suggestion in my comment above? If you run into any issues please let us know any specific errors you run into.
Hi @jkasten2 Thank you. You're right it works fine with these settings. Removing onesignal from dependencies made the code work earlier so I suspect from onesignal but the problem was a conflict between geolocator and onesignal dependencies.
I know it's not issue of onesignal but here is the issue I am having when I add these two dependencies together. If you have a suggestion I'll be happy to hear but if not you can close the issue. Thanks.
2019-03-19 23:47:23.050 27155-27155/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: tr.com.tabit.tabit, PID: 27155
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5962)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5554)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5493)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6247)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/tr.com.tabit.tabit-2/base.apk"],nativeLibraryDirectories=[/data/app/tr.com.tabit.tabit-2/lib/arm64, /data/app/tr.com.tabit.tabit-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)聽
at android.app.ActivityThread.installProvider(ActivityThread.java:5962)聽
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5554)聽
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5493)聽
at android.app.ActivityThread.-wrap2(ActivityThread.java)聽
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572)聽
at android.os.Handler.dispatchMessage(Handler.java:102)聽
at android.os.Looper.loop(Looper.java:154)聽
at android.app.ActivityThread.main(ActivityThread.java:6247)聽
at java.lang.reflect.Method.invoke(Native Method)聽
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)聽
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)聽
@figengungor Errors like this are pretty common so we created a Gradle plugin to solve version mismatch issues like this. Can you make sure you have the onesignal-gradle-plugin in your project?
I think you said you are using the Flutter SDK, the full details on how to add this plugin is noted on step 4.
https://documentation.onesignal.com/docs/flutter-sdk-setup#section-4-add-the-onesignal-gradle-plugin-android-
Ahhhh I can't believe I missed that step. Thank you so much @jkasten2. You made me very happy \O/
can you please help
after adding one signal library
this error is show and app is failed
the option setting 'android.enableseparateannotationprocessing=true' is experimental and unsupported
Most helpful comment
@figengungor Errors like this are pretty common so we created a Gradle plugin to solve version mismatch issues like this. Can you make sure you have the
onesignal-gradle-pluginin your project?I think you said you are using the Flutter SDK, the full details on how to add this plugin is noted on step 4.
https://documentation.onesignal.com/docs/flutter-sdk-setup#section-4-add-the-onesignal-gradle-plugin-android-