Crash: Failed resolution of FirebaseInstanceId at com.Backendless.push.FCMRegistration

Hi Backendless,

We are experiencing crashes in our Android app, which has been running for quite a while (over 4 years) without problems, and push notifications have been working fine as well.

Now, when Backendless.Messaging.registerDevice() is called, the app crashes with failed resolution of “FirebaseInstanceId” in com.Backendless.push.FCMRegistration (line #51). We are using Backendless 6.3.4.

Here is the debugger output:

FATAL EXCEPTION: main
     Process: com.salesandmarketingnetwork.newlines, PID: 21734
     java.lang.NoClassDefFoundError: Failed resolution of: 
Lcom/google/firebase/iid/FirebaseInstanceId;
         at
com.backendless.push.FCMRegistration$1.onComplete(FCMRegistration.java:51)
         at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
         at android.os.Handler.handleCallback(Handler.java:938)
         at android.os.Handler.dispatchMessage(Handler.java:99)
         at android.os.Looper.loopOnce(Looper.java:201)
         at android.os.Looper.loop(Looper.java:288)
         at android.app.ActivityThread.main(ActivityThread.java:7839)
         at java.lang.reflect.Method.invoke(Native Method)
         at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
      Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceId" on path: DexPathList[[zip file "/data/app/~~qgiZQ4avr47hUcNyhyHUxA==/com.salesandmarketingnetwork.newlines-8OSqIeXn_bw-LJkS8-4Aug==/base.apk"],nativeLibraryDirectories=[/data/app/~~qgiZQ4avr47hUcNyhyHUxA==/com.salesandmarketingnetwork.newlines-8OSqIeXn_bw-LJkS8-4Aug==/lib/x86_64,
/system/lib64, /system_ext/lib64]]
         at
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
         at
com.backendless.push.FCMRegistration$1.onComplete(FCMRegistration.java:51)
         at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
         at android.os.Handler.handleCallback(Handler.java:938)
         at android.os.Handler.dispatchMessage(Handler.java:99)
         at android.os.Looper.loopOnce(Looper.java:201)
         at android.os.Looper.loop(Looper.java:288)
         at android.app.ActivityThread.main(ActivityThread.java:7839)
         at java.lang.reflect.Method.invoke(Native Method)
         at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)

We are aware that FirebaseInstanceId is deprecated, but we don’t know if that is related to this issue.

The crash prevents receiving any Backendless handleFault() message, so no help there. We have been trying different versions of the Firebase dependencies, but so far without success.

Any help or direction on how to troubleshoot further would be much appreciated.

Thanks very much in advance,

Rick Cataldo

PS: I have also replied to these support topics: Push Notifications Mission fail, error on Firebase Instance Id, and Backendless.messaging.registerDevice crash app, in case these are related.

Hi, @rick-cataldo

I think it is related to some other libraries not to the Backendless. Did you try to find the solution in other more specified resources? Try this solution: Flutter: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId - Stack Overflow

Regards,
Marina

Hi Marina,

Thanks so much for pointing us in the right direction.

The addition of the following new dependency to the app-level build.gradle solved the problem:

implementation 'com.google.firebase:firebase-iid'

How strange that FCM so recently stopped working without this! I hope this topic will help some other users as well.

Thank you very much again for your help!

Best regards,

Rick

It seems Firebase no longer supports firebase-iid and now requires migrating to firebase-installations as of BOM 31.0.0 (coinciding with Cloud Messaging version 23.1.0) which was release Oct 2022 here. Is there any plan to migrate to the new implementation or guidance of how to work around where I would like to upgrade my Firebase dependencies to work with new Gradle version 8.0?

1 Like