firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

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.

Open zsperske opened this issue 1 year ago • 4 comments

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.

zsperske avatar Apr 11 '24 16:04 zsperske

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Apr 11 '24 16:04 google-oss-bot

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?

lehcar09 avatar Apr 11 '24 18:04 lehcar09

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_*"/>

ulfandersson avatar Apr 15 '24 10:04 ulfandersson

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?

zsperske avatar Apr 15 '24 15:04 zsperske

Hi @zsperske this issue should be fixed in the latest release of crashlytics. Thanks!

rlazo avatar May 16 '24 16:05 rlazo