测试环境 / 依赖项
- Android Studio:Android Studio Arctic Fox Beta 2 和 Bumblebee Canary 1
- AGP:7.1.0-alpha01
- Firebase Analytics:com.google.firebase:firebase-analytics-ktx:19.0.0
- Firebase Crashlytics:com.google.firebase:firebase-crashlytics-ktx:18.0.0
- minifyEnabled:true
- 针对 Firebase 的 Proguard 配置:无
发生了什么
当我使用 minifyEnabled = true
构建我的应用程序并尝试启动应用程序时,应用程序会在启动后立即崩溃,并显示以下崩溃日志:
2021-05-29 22:30:37.652 16541-16541/com.my.app.package.name E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.my.app.package.name, PID: 16541
java.lang.IncompatibleClassChangeError: Class j$.util.concurrent.i implements non-interface class e.a (declaration of 'j$.util.concurrent.i' appears in /data/app/~~xxxx==/com.my.app.package.name--xxxxxx==/base.apk!classes2.dex)
at com.google.firebase.components.x.<init>(:37)
at com.google.firebase.components.x.b(:44)
at com.google.firebase.components.n.t(:219)
at com.google.firebase.components.n.j(:138)
at com.google.firebase.components.n.<init>(:91)
at com.google.firebase.components.n.<init>(:45)
at com.google.firebase.components.n$b.e(:360)
at com.google.firebase.c.<init>(:427)
at com.google.firebase.c.p(:299)
at com.google.firebase.c.o(:267)
at com.google.firebase.c.n(:252)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7242)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6783)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6700)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7660)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
注意事项
- 将
minifyEnabled = false
配置可以修复该问题,应用程序可以按预期启动。 - 可能与java.lang.IncompatibleClassChangeError caused by R8 (AGP 7.0.0-beta02)相关或重复。