20

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'
Frank van Puffelen
  • 418,229
  • 62
  • 649
  • 645

4 Answers4

14

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.

bonnyz
  • 12,745
  • 5
  • 41
  • 64
  • I think there is nothing more that we can do about it. – Szymon Klimaszewski Sep 14 '16 at 11:10
  • *firebaser here* Thanks for the report. We're investigating what may have caused this regression. @bonnyz's answer is a valid workaround. I'll post here when there is an update or a proper fix. Update (2016-09-14 12:54 pm pdt): we've identified the cause of the issue and are working on a fix. The workaround remains valid. – Frank van Puffelen Sep 14 '16 at 19:55
  • Will you release it as hotfix? If not, then what is an expected release date? – Szymon Klimaszewski Sep 14 '16 at 19:58
  • 1
    @SzymonKlimaszewski The problem in 9.6.80 was identified and will be fixed in 9.6.83. Will keep you updated. – Doug Stevenson Sep 14 '16 at 22:38
  • 1
    The status can be tracked here: https://status.firebase.google.com/incident/Crash%20Reporting%20%28Beta%29/16003 – Doug Stevenson Sep 14 '16 at 23:27
  • I removed compile 'com.google.firebase:firebase-crash:9.x.x' from my build.gradle. But still crashing. Google says firebase crash is by default included in apply plugin: 'com.google.gms.google-services'. Is there any way to remove firebase crash completely – Prabhu M Sep 15 '16 at 05:41
  • That is not true. Make separate question for that – Szymon Klimaszewski Sep 15 '16 at 08:57
  • @SzymonKlimaszewski, Please check this http://stackoverflow.com/questions/39505604/how-to-disable-default-firebase-crash-reporting – Prabhu M Sep 15 '16 at 09:11
  • I don't use firebase-crash in my app, but error still occurred. – Alexander.Shtanko Sep 15 '16 at 13:54
  • @Alexander.Shtanko see accepted answer here http://stackoverflow.com/questions/39505604/how-to-disable-default-firebase-crash-reporting?noredirect=1#comment66354885_39505604 – Prabhu M Sep 16 '16 at 05:21
  • @FrankvanPuffelen I encountered the same issue with play services version 9.4.0 and commenting the firebase crash, worked. So the issue might be in 9.4.0 version also? – Vinil Narang Sep 16 '16 at 09:20
  • When will this be fixed? I know Firebase Crash is Beta, but this is just awful. – clocksmith Sep 22 '16 at 03:58
  • Experiencing the same issue with v11.0.2 again. :( – Kamran Ahmed Sep 18 '17 at 04:53
1

Disable the Firebase Analytics Crash Reporting, use the below code inside app.gradle file.Hope this will help you

configurations {

  all*.exclude group: 'com.google.firebase', module: 'firebase-crash'

}

Ram Suthakar
  • 210
  • 1
  • 13
0

9.6.83 still gives a different anr crash Our app when pushed to Play Store Beta and when installed on devices crashes the first time on launch. Subsequently it works , but we cannot push to prod without understanding the issue.

Here is the ANR crash report

java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.analytics.CampaignTrackingReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.analytics.CampaignTrackingReceiver"

Edit : We had to add compile 'com.google.android.gms:play-services-analytics:9.4.0' explicitly and the launch anr for first time got resolved. But I am not sure that was the fix as we dont use the library at all. Maybe Playstore fixed their bug to all apks?

0

Just for the record:

We solved the DynamiteModulesC NPE and Uncaught exception in Firebase runloop (3.0.0) by removing following line

//remove this "feature" if you should use it
FirebaseApp.setAutomaticResourceManagmentEnabled(true)

API description:

If set to true it indicates that Firebase should close database connections automatically when the app is in the background. Disabled by default.

(Might be, that we missed some configurations for correct usage of this feature, but App is working as expected after not enabling the ResourceManagment)

longi
  • 10,071
  • 8
  • 51
  • 86