Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

App crashes on Android #266

Closed nncl closed 6 years ago

nncl commented 6 years ago

Hello guys.

Today I updated to 7.0.7 version and it worked properly on iOS, but it makes the app crashes on Android 4.4. I rollbacked to version 7.0.6 and then it worked.

I don't know how to give you further details about it because I can no longer check logs since app crashes on initialization.

lsorese commented 6 years ago

Can confirm, also an issue on my end.

wfhm commented 6 years ago

@nncl Hi. Can you obtain device logs using Android Studio device monitor? Is the issue only reproducible with Android 4.4?

wfhm commented 6 years ago

@lsorese Can you provide us with device logs describing this issue? Does the issue occur with the same Android version mentioned by @nncl or are any other Android versions affected?

much-rebel commented 6 years ago

Same on Android 8.0.0 and others

Plugin v7.0.7, v7.0.6... API v26 Android 6.3.0 Cordova 7.0.1

log

Edit: just checked - 7.0.4 works ok

wfhm commented 6 years ago

@piscisLT

Here's the reason of this crash:

Caused by: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzt; or its super classes (declaration of 'com.google.android.gms.common.util.zzt' appears in /data/app/gwb.tknerbne.worker-T2Bwx15KxSfhK-NT0ZA9qw==/base.apk)

It can be explained by an outdated version of Google Play services libs used in your project. If you have any 3rd-party plugins that include com.google.android.gms packages, please make sure all of them have the same versions across your project. If there is a versioning conflict, you can solve it by changing the version of Google Play services libs in Pushwoosh plugin's plugin.xml from '11.0.2' to '+':

        <framework src="com.google.android.gms:play-services-gcm:+" />
        <framework src="com.google.android.gms:play-services-location:+" />
much-rebel commented 6 years ago

@wfhm

with these framework options I get another fatal:

FATAL EXCEPTION: main
                         E  Process: gwb.tknerbne.worker, PID: 4728
                         E  java.lang.AbstractMethodError: abstract method "android.os.IInterface com.google.android.gms.common.internal.zzd.zzd(android.os.IBinder)"
                         E      at com.google.android.gms.common.internal.zzn.zzajn(Unknown Source:98)
                         E      at com.google.android.gms.common.internal.zze.zzs(Unknown Source:48)
                         E      at com.google.android.gms.common.internal.zzi.zzajo(Unknown Source:57)
                         E      at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source:275)
                         E      at android.os.Handler.dispatchMessage(Handler.java:105)
                         E      at android.os.Looper.loop(Looper.java:164)
                         E      at android.app.ActivityThread.main(ActivityThread.java:6541)
                         E      at java.lang.reflect.Method.invoke(Native Method)
                         E      at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                         E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Plugins list used in my app is quite long so I have no idea how to properly debug if some are conflicting without spending days on it :/

wfhm commented 6 years ago

@nncl

This error indicates that you have different versions of google-play-services and firebase SDK. Please make sure that you have the same versions specified for com.google.android.gms and com.google.firebase packages in your plugin.xml.

By default, Pushwoosh plugin uses 11.0.2 version of these libs, so if you had changed the version of com.google.android.gms to '+' as was offered earlier, you should change com.google.firebase version to the same as well.

wfhm commented 6 years ago

@nncl Did you have a chance to test the solution above?