Flutter run fail in andriod studio Caused by: java.lang.IllegalStateException: The Crashlytics build ID is missing

Viewed 1620

Following are the dependencies added in pubspec.yaml

firebase_core: ^0.5.2 firebase_auth: ^0.18.3 firebase_crashlytics: ^0.2.3

I update the gradle-wrapper.properties like this: as seen somewhere as a solution to below issues. distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip

Firebase console shows the successful installation as below enter image description here

Still we are getting below

E/AndroidRuntime(10914): java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account. E/AndroidRuntime(10914): at android.app.ActivityThread.installProvider(ActivityThread.java:6905) E/AndroidRuntime(10914): at android.app.ActivityThread.installContentProviders(ActivityThread.java:6497) E/AndroidRuntime(10914): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6437) E/AndroidRuntime(10914): at android.app.ActivityThread.access$1800(ActivityThread.java:229) E/AndroidRuntime(10914): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1898) E/AndroidRuntime(10914): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(10914): at android.os.Looper.loop(Looper.java:148) E/AndroidRuntime(10914): at android.app.ActivityThread.main(ActivityThread.java:7402) E/AndroidRuntime(10914): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(10914): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) E/AndroidRuntime(10914): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Please advice.

1 Answers

I had a similar issue just now, but by following the steps in 'Upgrade to the Firebase Crashlytics SDK' managed to fix this.

Basically, you need to add the following to your build.gradle file in the android folder, in the dependencies section:

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'

Then in the app level build.gradle, where you've already added com.google.gms.google-services previously, add:

apply plugin: 'com.google.firebase.crashlytics'

Finally, in the dependencies section in the same file, add:

implementation 'com.google.firebase:firebase-crashlytics:17.3.0'

This should now work. This is assuming you don't have any of the Fabric repository stuff in there, which you'll need to remove. The details are in that link.

Related