Guy
Guy

Reputation: 6522

Firebase crash while using GCM

I'm facing a very weird issue. I just upgraded my play-services dependencies from version 10.0.1 to 10.2.0

I'm using these now:

compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.google.android.gms:play-services-gcm:10.2.0'

Now my app crashes every time I receiver a push notification. Notification is displayed and right after that I get a dialog saying that my app stopped working.

Crash LOG

FATAL EXCEPTION: main
               Process: com.avantcar.a2go, PID: 581
               java.lang.NoSuchMethodError: No static method zzaaj()Lcom/google/firebase/iid/zzg; in class Lcom/google/firebase/iid/zzg; or its super classes (declaration of 'com.google.firebase.iid.zzg' appears in /data/app/com.avantcar.a2go-1/base.apk:classes69.dex)
               at com.google.firebase.messaging.FirebaseMessagingService.zzF(Unknown Source)
               at com.google.firebase.iid.zzb.onStartCommand(Unknown Source)
               at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3010)
               at android.app.ActivityThread.-wrap17(ActivityThread.java)
               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442)
               at android.os.Handler.dispatchMessage(Handler.java:102)
               at android.os.Looper.loop(Looper.java:148)
               at android.app.ActivityThread.main(ActivityThread.java:5417)
               at java.lang.reflect.Method.invoke(Native Method)
               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

It seems like it's crashing because of something related to FCM, but I am not using FCM in my app yet. I'm still using GCM.

Upvotes: 2

Views: 1350

Answers (4)

Andras Kloczl
Andras Kloczl

Reputation: 8485

I had the same issue and it was because I was using a different version for messaging, so try to use the same version on all firebase related dependencies.

Upvotes: 4

rfellons
rfellons

Reputation: 666

for me this configuration

compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.0'

fixes multi dupex gradle compilation error on AndroidStudio 2.3.3.

Upvotes: 0

ktsakiris
ktsakiris

Reputation: 59

using google play services 10.2.0 and the same for firebase messaging worked for me.

compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'

Upvotes: 0

Teyam
Teyam

Reputation: 8082

You may want to please check your Android API level.

As mentioned in Google APIs for Android - Release Notes, updating your Google Play Services to 10.2 will require a minimum Android API level of 14.

Here are additional articles/SO post that will also help:

Upvotes: 0

Related Questions