← All Insights

Android Build Error - The Crashlytics build ID is missing

After migrating from Fabric IO to Firebase Crashlytics, some Android apps crash at launch with the error:

Fatal Exception: 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.

This error is confusing because the build succeeds — the crash only happens at runtime. This guide covers what causes it and how to resolve it.


The Problem

During migration from Fabric IO to Firebase Crashlytics, a common sequence is:

  1. Remove the Fabric Maven repository from the root-level build.gradle
  2. Remove Fabric plugins from the app-level build.gradle
  3. Remove Fabric imports and initialization code from the app
  4. Follow the Firebase Crashlytics onboarding steps
  5. Build successfully — but crash on launch

The app builds fine because the Crashlytics plugin compiles correctly. The crash happens because the Crashlytics Gradle plugin needs to embed a build ID at compile time, and something in the configuration is preventing it from doing so.


Things That Did Not Work

  • Regenerating the google-services.json file
  • Reconnecting the Firebase account in the Firebase console
  • Re-adding the deprecated Fabric plugin (not recommended)
  • Cleaning and rebuilding the project

The Fix

The solution involves two steps:

1. Remove and regenerate google-services.json

Delete the existing google-services.json from your app directory. Then use the Firebase Assistant in Android Studio (Tools > Firebase) to reconnect the app and download a fresh configuration file.

2. Keep the Fabric Maven repository

Even though you are migrating away from Fabric, keep this line in your root-level build.gradle:

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }  // keep this
    }
}

Removing the Fabric Maven repository while the Crashlytics plugin still has a transitive dependency on it causes the build ID embedding to fail silently.


Alternative Fix

If the above does not resolve the issue, upgrading Gradle to version 5.6.4 has been reported to resolve the same crash for some projects:

# gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip

Verify the Fix

After applying the fix, clean the project and run a fresh build:

./gradlew clean assembleDebug

Launch the app and confirm it no longer crashes. In the Firebase console, trigger a test crash using FirebaseCrashlytics.getInstance().crash() and verify it appears in the Crashlytics dashboard within a few minutes.


Conclusion

Crashlytics migration errors are often caused by incomplete cleanup rather than incorrect Firebase setup. Regenerating the google-services.json and keeping the Fabric repository reference during the transition resolves the missing build ID error in most cases.