Nosuchmethoderror with Firebasemessaging

Asked

Viewed 72 times

0

I’m getting the following error while running my app:

E/AndroidRuntime: FATAL EXCEPTION: main
                                                                              Process: br.com.igoroliv.youtubecanal, PID: 29233
                                                                              java.lang.NoSuchMethodError: No virtual method zzjt(Ljava/lang/String;)V in class Lcom/google/firebase/iid/FirebaseInstanceId; or its super classes (declaration of 'com.google.firebase.iid.FirebaseInstanceId' appears in /data/app/br.com.igoroliv.youtubecanal-1/base.apk)
                                                                                  at com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic(Unknown Source)
                                                                                  at br.com.igoroliv.youtubecanal.MainActivity.onCreate(MainActivity.java:61)

The wrong line is this:

FirebaseMessaging.getInstance().subscribeToTopic("todos");
FirebaseMessaging.getInstance().subscribeToTopic("live");
FirebaseMessaging.getInstance().subscribeToTopic("comunicados");
FirebaseMessaging.getInstance().subscribeToTopic("videos");

It was working until yesterday, I added some things in the code and now you’re giving this error when you open the app, I do not understand why, I did some research and most of the answers was to put the same version for all Compile in Gradle, but mine is already like this.

my Gradle:

compile 'com.google.firebase:firebase-storage:10.2.1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
  • 1

    By reading in another stack community, it may be a bug in the versions of your components. Check out these new components that you added.

  • The only thing I added was Gcmnetworkmanager with version: 'com.google.android.gms:play-services-gcm:11.0.4' which is apparently the most current

  • 1

    I did it! I had to change the gcm version to the same as firebase

  • Compile 'com.google.firebase:firebase-Storage:10.2.1' Compile 'com.google.firebase:firebase-core:10.2.1' Compile 'com.google.firebase:firebase-messaging:10.2.1' Compile 'com.google.android.gms:play-services-gcm:10.2.1'

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.