AGP 8.3.2: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: The Crashlytics build ID is missing.
After updating our AGP and Gradle versions to 8.3.2, we are now seeing:
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: The Crashlytics build ID is missing.
No other changes made, Crashlytics has been working for years.
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @zsperske, thank you for reaching out. I tried replicating the issue, however, I did not encounter the issue. Could you share the Crashlytics versions, as well as the Crashlytics Gradle version you're using? Aside from that, have you tried invalidating the cache and rebuilding the app to clean up the Gradle files?
Had the same issue after upgrading from AGP 8.2.2 to 8.3.2 - but only in release builds. (firebase bom 32.8.1)
Turns out it's related to resource shrinkage, our project is using "strict" resource shrinkage. (https://developer.android.com/build/shrink-code#strict-reference-checks)
See related issue https://github.com/firebase/firebase-android-sdk/issues/5562 and this comment: https://issuetracker.google.com/issues/311837855#comment14 "if you use strict mode you need the keep rule" (however, I still don't understand why the keep rule wasn't needed in 8.2.2?)
This keep.xml works for us:
<resources
xmlns:tools="http://schemas.android.com/tools"
tools:shrinkMode="strict"
tools:keep="@string/com_google_firebase_crashlytics_*"/>
Thank you so much @ulfandersson! That keep rule did the trick.
@lehcar09 the issue @ulfandersson links (https://github.com/firebase/firebase-android-sdk/issues/5562) seems like it wasn't actually fixed in AGP 8.3.0-alpha16 as mentions. Is the fix as simple as adding the keep rule to Crashlytics internally?
Hi @zsperske this issue should be fixed in the latest release of crashlytics. Thanks!