Skip to content

Crashlytics crashes release build with latest AGP 9 alpha #7367

Description

@ychescale9

Environment

  • Android Studio version: Android Studio Narwhal 3 Feature Drop | 2025.1.3
  • Firebase Component: Crashlytics
  • Component version: 3.0.6

android.r8.strictFullModeForKeepRules is enabled by default in latest AGP 9 alphas (see AGP 9 behavior changes) which is causing a runtime crash for release builds:

ava.lang.RuntimeException: Unable to create application MyApp: java.lang.NullPointerException: FirebaseCrashlytics component is not present.
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7836)
  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2546)
  at android.os.Handler.dispatchMessage(Handler.java:110)
  at android.os.Looper.loopOnce(Looper.java:248)
  at android.os.Looper.loop(Looper.java:338)
  at android.app.ActivityThread.main(ActivityThread.java:9067)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932)
Caused by: java.lang.NullPointerException: FirebaseCrashlytics component is not present.
  at MyApp.onCreate(r8-map-id-517a7ef736eaefc1cd138de170f05c7d0a6f5c98eb517963437b420334c422c3:20)
  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1381)
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7830)

To reproduce:

  • checkout this branch
  • run ./gradlew installProdRelease
  • launch the app and see the crash

Workaround:

Add android.r8.strictFullModeForKeepRules=false to gradle.properties.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions