2

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.

Guy
  • 6,414
  • 19
  • 66
  • 136
  • Which version of Android are you running the app on? – Joao Sousa Feb 24 '17 at 11:46
  • @JoaoSousa 6.0 Build number MPA44G – Guy Feb 24 '17 at 11:47
  • 2
    Do you import any of the Firebase libraries? Like firebase-messaging, or firebase-core. If you do, you need to update those to 10.2.0 as well. – Joao Sousa Feb 24 '17 at 11:50
  • No, I do use Smooch though, which apparently also supports FCM, but I commented out all of Smooch code, but it still crashes. I updated every possible library to 10.2.0 – Guy Feb 24 '17 at 12:25
  • Well try importing them then. You shouldn't really use GCM anyway. It looks like something internally is trying to call a method via reflection only available through FCM, so add `compile 'com.google.firebase:firebase-core:10.2.0'` and `compile 'com.google.firebase:firebase-messaging:10.2.0'` to your app.gradle – Joao Sousa Feb 24 '17 at 12:34
  • Thing is that I wasn't planning on migrating to FCM just yet. As far as I understand, migrating to FCM requires generating new API keys, also some work on backend etc. Or am I wrong here? – Guy Feb 24 '17 at 12:42
  • You're not wrong. Some backend work is needed, although it is very straightforward. – Joao Sousa Feb 24 '17 at 14:31
  • can you print and add to the question the list of app dependencies? ./gradlew app:dependencies – Diego Giorgini Feb 24 '17 at 15:24

4 Answers4

4

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.

Andras Kloczl
  • 8,415
  • 2
  • 21
  • 23
  • Sorry for forgetting to accept the answer. This is not exactly what was my problem, but it brought me to the solution. I was indeed using incompatible Firebase versions. – Guy Sep 22 '17 at 12:05
0

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:

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22
0

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'
ktsakiris
  • 59
  • 1
  • 10
0

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.

rfellons
  • 656
  • 12
  • 28