Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

Android app is crashing on registering. #186

Closed kleeb closed 8 years ago

kleeb commented 8 years ago

FATAL EXCEPTION: IntentService[GCMRegistrationService]

it looks for me like you either need to switch to Firebase: https://developers.google.com/cloud-messaging/android/android-migrate-fcm or upgrade some libs ?

in config xml you have <framework src="com.android.support:support-v4:+" /> which may be causing some incompatibility with Google Play services (I have them updated to the latest version 9.0.2)

some stacktrace:

06-22 10:33:56.049 21777 21960 E AndroidRuntime: 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/net.ays.PREPROD217657-1/base.apk) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at com.google.android.gms.iid.zzd.zzeb(Unknown Source) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.zza(Unknown Source) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at com.pushwoosh.GCMRegistrationService.register(GCMRegistrationService.java:37) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at com.pushwoosh.GCMRegistrationService.onHandleIntent(GCMRegistrationService.java:106) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 06-22 10:33:56.049 21777 21960 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)

kleeb commented 8 years ago

setting <framework src="com.android.support:support-v4:23+" /> should fix that

details: http://stackoverflow.com/questions/37337393/android-google-cloud-messaging-gcm-token-generation-crash-after-firebase-relat

kleeb commented 8 years ago

installed it on our app from forked plugin and its working, devices are registering and app is not crashing:

https://github.com/kleeb/pushwoosh-phonegap-plugin/pull/1/commits/fa0db397148ac0fa3f435c857799302b988d5787

DimanAM commented 8 years ago

in config xml you have which may be causing some incompatibility with Google Play services (I have them updated to the latest version 9.0.2)

It's actually the opposite. Google has fixed incopatibility issues with support-v4:24.0.0-beta1 in 9.0.1 release. Try updating Android SDK and rebuilding your project. If the issue persist please attach the build log.

kleeb commented 8 years ago

we use the latest version of Phonegap Build (cli-6.1.0) probably they use the older sdk, so the only option until they fix it on their side is use our forked solution fix

DimanAM commented 8 years ago

Phonegap Build builds projects remotely and uses an outdated version of Android SDK (it still uses Google Play services v8.4.0). Please use pushwoosh-pgb-plugin for Phonegap Build.

kleeb commented 8 years ago

thanks!