Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

Fatal exception (in GCMRegistrationService) on load on Android after SDK tools update #178

Closed pugwonk closed 8 years ago

pugwonk commented 8 years ago

I'm getting a crash on load across multiple devices which looks to be very similar to https://github.com/phonegap/phonegap-plugin-push/issues/909. This is using Android SDK Tools 25.1.6.

There's a long and complex thread in the linked bug but, in case it helps debugging, I am using cordova-plugin-mauron85-background-geolocation, which the thread suggests might be related because it links a different version of the support libraries.

I'm using version 5.0.2 of pushwoosh-phonegap-plugin. Everything worked fine prior to me updating the SDK tools.

05-24 16:34:04.020: E/AndroidRuntime(10406): FATAL EXCEPTION: IntentService[GCMRegistrationService]
05-24 16:34:04.020: E/AndroidRuntime(10406): Process: org.mycoast.mobile, PID: 10406
05-24 16:34:04.020: E/AndroidRuntime(10406): java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/org.mycoast.mobile-1/base.apk)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at com.google.android.gms.iid.zzd.zzeC(Unknown Source)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at com.google.android.gms.iid.zzd.<init>(Unknown Source)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at com.google.android.gms.iid.zzd.<init>(Unknown Source)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at com.pushwoosh.GCMRegistrationService.unregister(GCMRegistrationService.java:73)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at com.pushwoosh.GCMRegistrationService.onHandleIntent(GCMRegistrationService.java:110)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at android.os.Handler.dispatchMessage(Handler.java:102)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at android.os.Looper.loop(Looper.java:148)
05-24 16:34:04.020: E/AndroidRuntime(10406):    at android.os.HandlerThread.run(HandlerThread.java:61)
05-24 16:34:04.021: W/ActivityManager(788):   Force finishing activity org.mycoast.mobile/.MainActivity
shaders commented 8 years ago

Make sure you update Google Support Library and Google Play Services Library in Android SDK to the same (latest) version. The error you receive is that the class in Android Support Library is not as it wanted to be from Google Play Services Library. They have to match.

notDanish commented 7 years ago

This issue is definitely not solved. The solution given does not work and I'm getting the same error!

shaders commented 7 years ago

You need Google Play Services > than 9.0.1 https://developers.google.com/android/guides/releases

The Google Play services version 9.0.1 release is now available. This release fixes the following issues with the version 9.0.0 release: Fixes a class change compilation error with ContextCompat.getNoBackupFilesDir().

notDanish commented 7 years ago

@shaders Thanks.