Divya Gupta
Divya Gupta

Reputation: 492

UnmetDependencyException: The Crashlytics build ID is missing

After adding Fabric app id in application manifest and initializing fabric in application class file, I am now facing another exception with the following stacktrace.

java.lang.RuntimeException: Unable to create application fibamlscan.app.App: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: 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.
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6309)
    at android.app.ActivityThread.access$1200(ActivityThread.java:241)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1807)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7156)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
 Caused by: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: 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.
    at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:243)
    at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:211)
    at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44)
    at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611)
    at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43)
    at io.fabric.sdk.android.Kit.initialize(Kit.java:69)
    at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:466)
    at io.fabric.sdk.android.Fabric.init(Fabric.java:410)
    at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:368)
    at io.fabric.sdk.android.Fabric.with(Fabric.java:339)
    at fibamlscan.app.App.onCreate(App.java:28)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1158)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6304)
    at android.app.ActivityThread.access$1200(ActivityThread.java:241) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1807) 
    at android.os.Handler.dispatchMessage(Handler.java:106) 
    at android.os.Looper.loop(Looper.java:214) 
    at android.app.ActivityThread.main(ActivityThread.java:7156) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) 

I have tried literally everything possible as suggested in stacktrace. but nothing worked in getting rid of this error.

I have also checked inside my build folder that build id is being generated after every build, but I cannot figure out why Crashlytics cannot use that build id.

This is the build id generated inside res/values of build folder automatically.

    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <resources xmlns:tools="http://schemas.android.com/tools">
<!--
  This file is automatically generated by Crashlytics to uniquely 
  identify individual builds of your Android application.

  Do NOT modify, delete, or commit to source control!
-->
    <string tools:ignore="UnusedResources,TypographyDashes" name="com.crashlytics.android.build_id" translatable="false">1f3b35bb-2686-4f3f-91fe-87e8a05e2f71</string>
    </resources>

Upvotes: 0

Views: 10678

Answers (5)

Simmam
Simmam

Reputation: 135

Though it is a older question, adding the answer that worked for us as We got this error today but not of much valid help available in web or even here.

Following are the changes made to remove the error "Crashlytics build ID is missing". Please note, this error appears only when the app is run but not in Gradle Sync, Build, Rebuild.

  1. Add the following line to app\res\strings\strings.xml

     <string name="com.google.firebase.crashlytics.mapping_file_id">none</string>
    
  2. Make sure the following dependencies exists in build.gradle(Project)

     classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
    
  3. Make sure following dependencies exists in build.gradle(Module)

     // Crashlytics
     implementation 'com.google.firebase:firebase-crashlytics:18.3.3'
     implementation 'com.google.firebase:firebase-crashlytics-ktx:18.3.2'
    

Note: Use above lines as applicable (Java and or kotlin), please update the version numbers as applicable.

Sync Gradle, Rebuild, Run the app. Error should disappear.

Thanks to all contributors who indicated various above points.

Upvotes: 2

Sushant Gosavi
Sushant Gosavi

Reputation: 3825

Same issue I am facing resolved by two step

Step 1 - Enable Crashlatics in firebase consol - select project -> Quality- > Crashlatics -> Click Enable Button

Step 2 - downgrade the gradle version form

classpath 'com.android.tools.build:gradle:4.1.0-alpha08' 

To

classpath 'com.android.tools.build:gradle:3.5.3'

Work Perfectly for me But make sure you use below configuration in project gradle file

   classpath 'io.fabric.tools:gradle:1.31.2' 

   repositories {
      
         maven {
               url 'https://maven.fabric.io/public'
         }
    }

And app gradle file

apply plugin: 'io.fabric' 

and dependency

implementation "com.crashlytics.sdk.android:crashlytics:$FIREBASE_CRASHLATICS_VERSION"

Upvotes: 0

Divya Gupta
Divya Gupta

Reputation: 492

I know I took too much time to notify that I found the solution or not, but I found the solution a few weeks after asking the question itself, and the solution is in no way related to Firebase Crashlytics, and also none of he answers I got here worked for me, and I don't know why. I searched the internet for quite a long time after I found the solution, to find out why that silly solution worked despite of the fact that it is unrelated.

So here is the solution, as far as I can remember, since I found solution quite a long time ago, I think I changed the app icon to some custom app icon, and changed the app icon reference in manifest file also. And that worked like a charm!!

I am really sorry If I can't give an explanation for the solution because it was a hit and trial method, but do try it in your end and tell me if it worked or not. And in case if it worked, and you found a convincing explanation of why it worked, please let me know in the comments section.

Upvotes: 0

Kingfisher Phuoc
Kingfisher Phuoc

Reputation: 8190

perhaps it's a little bit old, but I had this issue as well. I had to put those plugins IN ORDER at the bottom of build.gradle file:

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

Upvotes: 1

Kevin Kokomani
Kevin Kokomani

Reputation: 1616

Fabric/Firebaser here -

This is usually due to a issue with configuring the instructions for installing Fabric. Ensure that ext.enableCrashlytics = false isn't set in any build configuration that you're calling the Fabric.with statement in.

Also make sure that apply plugin 'io.fabric' is in your build.gradle after apply plugin: 'com.android.application.

Finally, if you happen to be running much older versions of Fabric or Crashlytics, try updating those dependencies. Complete instructions and information here: https://fabric.io/kits/android/crashlytics/install.

Upvotes: 2

Related Questions