ReallySmallSoftware / cordova-plugin-firebase-crashlytics

Google Firebase Crashlytics Cordova plugin
Other
32 stars 80 forks source link

java.lang.IllegalStateException: The Crashlytics build ID is missing. #41

Open vincentdelmundo opened 3 years ago

vincentdelmundo commented 3 years ago

Expected Behavior

No error.

Actual Behavior

Runtime Error (on app launch):

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.

Steps to Reproduce the Problem

This occurred on app launch.

Specifications

jaimealvarezl commented 3 years ago

Were you able to fix this error?

vincentdelmundo commented 3 years ago

@jaimealvarezl

Were you able to fix this error?

Not yet. Right now, we are using "cordova-plugin-firebase-crashlytics": "1.0.0".

jaimealvarezl commented 3 years ago

I found out I had to do so manual changes in order to make it work. Following Firebase Crashlytics getting started guide .

I added classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0' project-level build.gradle and apply plugin: 'com.google.firebase.crashlytics' app-level build.gradle

I everything started to work.

tehmaestro commented 3 years ago

Hi, I almost cried when I finally found the solution. Thanks to this issue: https://github.com/chemerisuk/cordova-support-google-services/issues/9

It seems that, postBuildExtras gets overriden, by any plugin. Well I was already using it somewhere else, so basically, the firebase crashlytics plugin was not being applied, at all. I suggest using cdvPluginPostBuildExtras which is an array, and any plugin can register its own function to run.

So, the gradle becomes:

cdvPluginPostBuildExtras.add({
    apply plugin: com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsPlugin
})

I know! I just saved your day! 😍 . Well mine got saved by the good guys that took the time to post this issue on the other cordova plugin. Thanks guys.

terreng commented 3 years ago
cdvPluginPostBuildExtras.add({
    apply plugin: com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsPlugin
})

@tehmaestro This solved the issue, and saved my day. Thank you!