I'm trying to include OneSignal push notification into my Xamarin android app, In OneSignal panel it says that there is a device reachable but when I run my application on (Sony Xperia E5303) it says :
Error getting Google Ad id:
[OneSignal] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;
[OneSignal] at com.onesignal.AdvertisingIdProviderGPS.getIdentifier(AdvertisingIdProviderGPS.java:39)
[OneSignal] at com.onesignal.OneSignal$6.run(OneSignal.java:631)
[OneSignal] at java.lang.Thread.run(Thread.java:818)
[OneSignal] Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.identifier.AdvertisingIdClient" on path: DexPathList[[zip file "/data/app/com.app.app.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app.app.app-1/lib/arm64, /data/app/com.app.app.app-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
[OneSignal] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[OneSignal] at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[OneSignal] at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[OneSignal] ... 3 more
[OneSignal] Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.ads.identifier.AdvertisingIdClient
[OneSignal] at java.lang.Class.classForName(Native Method)
[OneSignal] at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[OneSignal] at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[OneSignal] at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[OneSignal] ... 4 more
I've already checked google play services version, it is 11.7.46, seems updated. How can I solve this error?
The issue java is complaining about is that it is likely missing a jar file or import because whatever program you are running does not have dependent classes to understand what the Google Ad Id is defined as. The likely solution is going to be importing a new dependency, if you want to know what it is it's likely the packages mentioned in the exception. (the ones beginning in com).
If you don't know what those packages are you can try a google search for some of them or even the class name and see if you can find a reputable source to download and important the package from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With