I am seeing this crash in FirebaseCrashlytics console for my Android app on PlayStore.
My app is Cordova based and uses https://github.com/fechanique/cordova-plugin-fcm Plugin for Firebase Cloud Messaging.
Here is the crash logs from Firebase Crashlytics Dashboard.
Fatal Exception: com.google.android.gms.tasks.RuntimeExecutionException
java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException:
TOO_MANY_REGISTRATIONS
com.gae.scaffolder.plugin.FCMPlugin$1.onComplete
Caused by java.io.IOException
java.util.concurrent.ExecutionException: java.io.IOException: TOO_MANY_REGISTRATIONS
Caused by java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: TOO_MANY_REGISTRATIONS
at com.google.firebase.messaging.FirebaseMessaging.blockingGetToken(com.google.firebase:firebase-messaging@@23.0.0:9)
at com.google.firebase.messaging.FirebaseMessaging.lambda$getToken$3$com-google-firebase-messaging-FirebaseMessaging(com.google.firebase:firebase-messaging@@23.0.0:1)
at com.google.firebase.messaging.FirebaseMessaging$$ExternalSyntheticLambda10.run(:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.6.0:2)
at java.lang.Thread.run(Thread.java:923)
Culprit devices
My app is crashing for Pixel 2 XL, Galaxy S20 FE 5G, ELS-NX9
What I have tried?
I have tried with Pixel 2 XL emulator but I do not see the crash.
I have 3 questions?
- What is the root cause of this issue?
- How to reproduce this on Emulator?
- How to fix this issue?
Related thread I found on Stackoverflow
Also I have seen a related thread here but it does not answer my question. According to one of the answers there, the crash is more likely to occur when the app is run on Firebase Test Lab. But in my case these crashes are happening with real users not with Robots(Test Lab).