Google Play预启动报告报错:无法实例化BlankActivity
Google Play预启动报告出现com.google.testing类找不到的异常原因分析
以下是几个可能的原因:
Google Play测试框架自身问题
预启动报告由Google Play内部测试工具(如Helium/UTP)生成,这个异常大概率是测试框架的组件加载失败导致的,和你的应用代码完全无关。测试工具在运行时会尝试初始化自身的BlankActivity,但可能因工具版本、环境配置问题出现类找不到的错误。代码收缩工具的误配置
如果你使用了ProGuard/R8,检查是否在混淆规则中意外添加了com.google.testing.*的保留规则,或者反向混淆映射文件出现错误。不过这种情况概率较低,毕竟你的项目根本没有引入该依赖。测试环境兼容性问题
预启动测试使用的设备/模拟器系统版本可能和测试工具存在兼容性冲突,导致Dex加载机制无法找到测试工具APK中的类。Google Play服务临时故障
偶尔Google Play的测试服务会出现异常,生成错误的报告。这种情况可以尝试重新上传应用版本,或者忽略该报告——只要你的应用在本地测试中一切正常。
异常信息
Exception java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.google.testing.helium.utp.android.companion.instrumentations.uid/com.google.testing.helium.utp.android.companion.activities.BlankActivity}: java.lang.ClassNotFoundException: Didn't find class "com.google.testing.helium.utp.android.companion.activities.BlankActivity" on path: DexPathList[[zip file "/data/app/~~C1cmoyISzg5fmEUSMOhwmg==/com.google.testing.helium.utp.android.companion.instrumentations.uid-w1rDXgaGUs9bWsebvD-zuw==/base.apk"],nativeLibraryDirectories=[/data/app/~~C1cmoyISzg5fmEUSMOhwmg==/com.google.testing.helium.utp.android.companion.instrumentations.uid-w1rDXgaGUs9bWsebvD-zuw==/lib/x86_64, /system/lib64, /system_ext/lib64]] at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3613) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3864) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2253) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:201) at android.os.Looper.loop (Looper.java:288) at android.app.ActivityThread.main (ActivityThread.java:7870) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003) Caused by java.lang.ClassNotFoundException: Didn't find class "com.google.testing.helium.utp.android.companion.activities.BlankActivity" on path: DexPathList[[zip file "/data/app/~~C1cmoyISzg5fmEUSMOhwmg==/com.google.testing.helium.utp.android.companion.instrumentations.uid-w1rDXgaGUs9bWsebvD-zuw==/base.apk"],nativeLibraryDirectories=[/data/app/~~C1cmoyISzg5fmEUSMOhwmg==/com.google.testing.helium.utp.android.companion.instrumentations.uid-w1rDXgaGUs9bWsebvD-zuw==/lib/x86_64, /system/lib64, /system_ext/lib64]] at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:218) at java.lang.ClassLoader.loadClass (ClassLoader.java:379) at java.lang.ClassLoader.loadClass (ClassLoader.java:312) at android.app.AppComponentFactory.instantiateActivity (AppComponentFactory.java:95) at android.app.Instrumentation.newActivity (Instrumentation.java:1285) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3600)
内容的提问来源于stack exchange,提问作者Piotr Aleksander Chmielowski
相关产品推荐
相关产品推荐

