Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Crash produces ANR during launch

Tags:

Recently I got feedback and also I was able to reproduce it easily on my Nexus 5 with cleared app data. Simply, when adding compile 'com.google.firebase:firebase-crash:9.4.0' only to project dependencies I get following Exception:

09-14 00:47:54.899 3129-3129/com.szyk.myheart E/FirebaseCrash: Failed to initialize crash reporting
                                                           java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
                                                               at bol.<init>(:com.google.android.gms.DynamiteModulesC:3201)
                                                               at com.google.firebase.crash.internal.api.FirebaseCrashApiImpl.init(:com.google.android.gms.DynamiteModulesC:67)
                                                               at bnu.onTransact(:com.google.android.gms.DynamiteModulesC:60)
                                                               at android.os.Binder.transact(Binder.java:387)
                                                               at com.google.firebase.crash.internal.zzd$zza$zza.zza(Unknown Source)
                                                               at com.google.firebase.crash.FirebaseCrash.<init>(Unknown Source)
                                                               at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                               at com.google.firebase.FirebaseApp.zza(Unknown Source)
                                                               at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                               at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                               at com.google.firebase.FirebaseApp.zzek(Unknown Source)
                                                               at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                               at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
                                                               at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
                                                               at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                               at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
                                                               at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
                                                               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
                                                               at android.app.ActivityThread.-wrap1(ActivityThread.java)
                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
                                                               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)

The issue is more stranger, because once it will produce ANR and crash, then it works in next launches.

My dependencies:

compile 'com.google.firebase:firebase-core:9.4.0'
//not working  compile 'com.google.firebase:firebase-crash:9.4.0'
compile 'com.google.firebase:firebase-invites:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'

compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-drive:9.4.0'
like image 434
Szymon Klimaszewski Avatar asked Sep 13 '16 23:09

Szymon Klimaszewski


People also ask

What will cause ANR error?

Application Not Responding (ANR) errors are triggered when the UI thread of the application is not responding for more than 5 seconds.

How do I know if firebase is crashing?

Open your app from the home screen of your test device or simulator. In your app, press the "Test Crash" button that you added using the code above. After your app crashes, run it again from Xcode so that your app can send the crash report to Firebase.

How do you detect ANR?

There are some common patterns to look for when diagnosing ANRs: The app is doing slow operations involving I/O on the main thread. The app is doing a long calculation on the main thread. The main thread is doing a synchronous binder call to another process, and that other process is taking a long time to return.

Is firebase Crashlytics real time?

Firebase Crashlytics, a real time crash reporting tool, helps you prioritize and fix your most pervasive crashes based on the impact on real users. Crashlytics also easily integrates into your Android, iOS, macOS, tvOS, and watchOS apps.


1 Answers

The issue has been introduced with the Google Play Services 9.6.80 (currently in rollout) and affects all the apps using the Firebase Crash reporting (despite of the version bundled in your app).

  • Temporary solution: disable Firebase Crash by removing the following entry from the build.gradle:

    compile 'com.google.firebase:firebase-crash:9.x.x'

  • Long term solution: wait that Google releases a fixed version of the GPS before enabling Firebase Crash again.


UPDATE 09/16:

Google is rolling out a fixed version of Google Play Services (9.6.83) which addresses the issue with Firebase Crash.

like image 140
bonnyz Avatar answered Oct 22 '22 09:10

bonnyz