64

As per new version of Firebase Crashlytics added in Our App and application stopped at launch time.

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.

App-Level Gradle apply plugin: 'com.google.firebase.crashlytics'

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

Project-Levle Gradle classpath 'com.google.gms:google-services:4.3.3' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'

Follow steps by step from Firebase guides Firebase Guides

But earlier Fabric version is too much better than current one.

Any help will be appreciated.

seyed Jafari
  • 1,235
  • 10
  • 20
Pratik Dodiya
  • 2,337
  • 1
  • 19
  • 12

9 Answers9

75

In the build.gradle at the application level, add the following imports
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

Then, in the gradle/wrapper/gradle-wrapper.properties file, upgrade your gradle version to 5.6.4
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

I used to run my app with gradle 5.1.1 and upgrading to the version 5.6.4 fixed my problems

I hope it'll help you !

FDuhen
  • 4,097
  • 1
  • 15
  • 26
  • Thanks, this helped to resolve the issue. I've checked at https://services.gradle.org/distributions/ that 5.6.4 is the most recent version 5. – Martijn Dec 15 '20 at 10:50
  • 1
    This is why google document sucks. There is no mention of this. Wasted 1 hr trying to add the id somehow by updating google-services.json and what not. – TiN Aug 27 '21 at 23:41
  • Also remember to include the buildscript dependencies classpath in the root build.gradle as mentioned by Amir Raza – TiN Aug 27 '21 at 23:42
  • I am trying to remove crashlytics since my team is migrating to Sentry. When i removed all references to Crashlytics i am getting this error `E/FirebaseCrashlytics: 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.` how do i resolve this? – Etienne Lawlor Apr 27 '23 at 02:18
31

That normally happens when the plugin apply plugin: 'com.google.firebase.crashlytics' is missing in build.gradle app level.

23

If anyone still have problem with this issue, try using crashlytics gradle verions 2.1.1 in project level gradle. I solved my problem by doing so.

buildscript {       
    ...
    dependencies {
        ... 
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'    
    }
}
Amir Raza
  • 2,320
  • 1
  • 23
  • 32
  • While indeed downgrading this from 2.4.1 to 2.1.1 (or even 2.2.1) resolved the issue, it's probably a better option to update the cradle version in the gradle/wrapper/gradle-wrapper.properties file, as instructed by xerib: https://stackoverflow.com/a/63795391/2439941 – Martijn Dec 15 '20 at 10:48
20

please add

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

to your project's build gradle. And don't forget to add following lines to your app's build gradle

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}
Lahiru Prasanna
  • 1,012
  • 2
  • 15
  • 32
12

It will also happen if you forgot to include classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' in your project level build.gradle

buildscript {
    repositories {
        // Check that you have Google's Maven repository (if not, add it).
        google()
    }

    dependencies {
        // ...

        // Check that you have the Google services Gradle plugin v4.3.2 or later
        // (if not, add it).
        classpath 'com.google.gms:google-services:4.3.8'

        // Add the Crashlytics Gradle plugin
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
    }
}

allprojects {
    repositories {
        // Check that you have Google's Maven repository (if not, add it).
        google()
    }
}
flamyoad
  • 519
  • 7
  • 15
4

Add the code below to project/android/app/build.gradle

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

Chinedu Ofor
  • 707
  • 9
  • 11
3

The only thing that solved my problem was to add the following line - <string name="com.crashlytics.android.build_id">1</string> to strings.xml, as suggested here.

TDG
  • 5,909
  • 3
  • 30
  • 51
0

add this line

implementation "com.google.firebase:firebase-iid"

this will solve this problem

Alhaj
  • 9
  • 2
  • Don't see such a plugin listed @ https://firebase.google.com/docs/android/setup#available-libraries almost thought this wouldn't work. – Anand Rockzz Jul 10 '22 at 13:14
0

After several hours i finally figured it out. I used ./gradlew app:dependencies command to list the dependency tree just to notice, that some libraries (that were not up to date) used older version of crashlytics library. I updated them and the issue was finally gone!