Closed Linats closed 6 months ago
还有一些线索
Line 302661: 10-22 13:22:51.648 10299 1763 1763 I [xxxSdk]包名.MainPluginProcessService: onCreate:包名.MainPluginProcessService@52c42cd Line 302662: 10-22 13:22:51.648 10299 1763 1763 I [xxxSdk]包名.MainPluginProcessService: onBind:包名.MainPluginProcessService@52c42cd Line 302663: 10-22 13:22:51.652 10299 30127 30127 I [xxxSdk]com.tencent.shadow.dynamic.manager.BaseDynamicPluginManager: onServiceConnected connectCountDownLatch:java.util.concurrent.CountDownLatch@7170bb3[Count = 1] Line 302664: 10-22 13:22:51.652 10299 1763 1790 I [xxxSdk]包名.MainPluginProcessService: setUuidManager uuidManager==com.tencent.shadow.dynamic.host.BinderUuidManager@2ecce93 Line 302665: 10-22 13:22:51.652 10299 30127 30127 I [xxxSdk]com.tencent.shadow.dynamic.manager.BaseDynamicPluginManager: onServiceConnected countDown:java.util.concurrent.CountDownLatch@7170bb3[Count = 0] Line 302666: 10-22 13:22:51.652 10299 30127 1698 I [xxxSdk]com.tencent.shadow.dynamic.manager.BaseDynamicPluginManager: service connected 272 Line 302667: 10-22 13:22:51.652 10299 30127 1698 I [xxxSdk]com.tencent.shadow.dynamic.manager.PluginManagerThatUseDynamicLoader: loadRunTime mPpsController:com.tencent.shadow.dynamic.host.PpsController@9d2b570 Line 302668: 10-22 13:22:51.653 10299 30127 1698 I [xxxSdk]com.tencent.shadow.dynamic.manager.PluginManagerThatUseDynamicLoader: loadRunTime ppsStatus:PpsStatus{uuid='', runtimeLoaded=false, loaderLoaded=false, uuidManagerSet=true} Line 302669: 10-22 13:22:51.653 10299 1763 1790 I [xxxSdk]包名.MainPluginProcessService: loadRuntime uuid:F935C364-F179-4E48-9B1C-DB368BE3701F Line 302671: 10-22 13:22:51.659 10299 1763 1790 I [xxxSdk]com.tencent.shadow.dynamic.host.DynamicRuntime: last apkPath:/data/user/0/包名/files/ShadowPluginManager/UnpackedPlugin/xxx-sdk/7adba112ba9c7509995c995900b0f060/plugin.zip/sample-runtime-release.apk new apkPath:/data/user/0/包名/files/ShadowPluginManager/UnpackedPlugin/xxx-sdk/7adba112ba9c7509995c995900b0f060/plugin.zip/sample-runtime-release.apk Line 302672: 10-22 13:22:51.659 10299 1763 1790 I [xxxSdk]com.tencent.shadow.dynamic.host.DynamicRuntime: 已经加载相同apkPath的runtime了,不需要加载 Line 302673: 10-22 13:22:51.659 10299 30127 1698 I [xxxSdk]com.tencent.shadow.dynamic.manager.PluginManagerThatUseDynamicLoader: loadPluginLoader mPluginLoader:null Line 302674: 10-22 13:22:51.659 10299 30127 1698 I [xxxSdk]com.tencent.shadow.dynamic.manager.PluginManagerThatUseDynamicLoader: loadRunTime ppsStatus:PpsStatus{uuid='F935C364-F179-4E48-9B1C-DB368BE3701F', runtimeLoaded=true, loaderLoaded=false, uuidManagerSet=true} Line 302675: 10-22 13:22:51.660 10299 1763 1790 I [xxxSdk]包名.MainPluginProcessService: loadPluginLoader uuid:F935C364-F179-4E48-9B1C-DB368BE3701F mPluginLoader:null Line 302676: 10-22 13:22:51.664 10299 1763 1790 I [xxxSdk]包名.MainPluginProcessService: 取出uuid==F935C364-F179-4E48-9B1C-DB368BE3701F的Loader apk:/data/user/0/包名/files/ShadowPluginManager/UnpackedPlugin/xxx-sdk/7adba112ba9c7509995c995900b0f060/plugin.zip/sample-loader-release.apk
VerifyError一般是两个类有依赖关系,编译时依赖的版本和运行时依赖的版本接口不一致时抛出的异常。如果单看ShadowActivityDelegate
的话,可能有问题的是它会依赖HostActivityDelegate
接口。HostActivityDelegate
接口是打包在宿主中的,其余类包括MixResources
都是打包在loader.apk
中的。所以我首先怀疑的是你修改了什么代码,使得宿主和插件的接口不匹配了。
另外你贴出来的堆栈看起来不全,没法判断是否看到了root cause。
关于只在Android 12机型上有复现这一点,目前看到的信息没有值得支撑这一机型特点的证据。sample在android 12的虚拟机上是可以正常运行的。只看贴出来的堆栈部分,也没有涉及到Android 12新增的API。
建议还是先检查一下对SDK都有哪些修改,以及基于SDK的什么版本。
对框架部分检查过修改点,除了增加一些log的打印,没有对SDK框架部分的修改。 是基于SDK 2.0.12版本。
问题确实都是在android 12上报的,询问部分用户是在升级OS后进入插件发生,但非必现。
下面还有另外一台设备类似的LOG:
Line 321206: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: *** Uncaught remote exception! (Exceptions are not yet supported across processes.) Line 321207: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: com.tencent.shadow.core.runtime.MixResources Line 321208: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.FutureTask.report(FutureTask.java:123) Line 321209: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.FutureTask.get(FutureTask.java:193) Line 321210: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at com.tencent.shadow.dynamic.loader.impl.DynamicPluginLoader.loadPlugin(DynamicPluginLoader.kt:82) Line 321211: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at com.tencent.shadow.dynamic.loader.impl.PluginLoaderBinder.onTransact(PluginLoaderBinder.kt:43) Line 321212: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at android.os.Binder.execTransactInternal(Binder.java:1220) Line 321213: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at android.os.Binder.execTransact(Binder.java:1179) Line 321214: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: com.tencent.shadow.core.runtime.MixResources Line 321215: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.FutureTask.report(FutureTask.java:123) Line 321216: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.FutureTask.get(FutureTask.java:193) Line 321217: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at com.tencent.shadow.core.loader.blocs.LoadPluginBloc$loadPlugin$buildRunningPlugin$1.run(Unknown Source:77) Line 321218: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) Line 321219: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.FutureTask.run(FutureTask.java:266) Line 321220: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) Line 321221: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) Line 321222: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at java.lang.Thread.run(Thread.java:920) Line 321223: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: Caused by: java.lang.NoClassDefFoundError: com.tencent.shadow.core.runtime.MixResources Line 321224: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at com.tencent.shadow.core.runtime.ShadowContext.getResources(ShadowContext.java:110) Line 321225: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:210) Line 321226: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:147) Line 321227: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at com.tencent.shadow.core.loader.blocs.CreateApplicationBloc.createShadowApplication(Unknown Source:98) Line 321228: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at com.tencent.shadow.core.loader.blocs.LoadPluginBloc$loadPlugin$buildApplication$1.call(Unknown Source:103) Line 321229: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: at com.tencent.shadow.core.loader.blocs.LoadPluginBloc$loadPlugin$buildApplication$1.call(Unknown Source:0) Line 321230: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: ... 4 more Line 321231: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: Caused by: java.lang.VerifyError: Verifier rejected class com.tencent.shadow.core.runtime.MixResources: android.content.res.XmlResourceParser com.tencent.shadow.core.runtime.MixResources.getAnimation(int) failed to verify: android.content.res.XmlResourceParser com.tencent.shadow.core.runtime.MixResources.getAnimation(int): [0xB] can't resolve returned type 'Unresolved Reference: android.content.res.XmlResourceParser' or 'Reference: android.content.res.XmlResourceParser' Line 321232: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.content.res.ColorStateList com.tencent.shadow.core.runtime.MixResources.getColorStateList(int) failed to verify: android.content.res.ColorStateList com.tencent.shadow.core.runtime.MixResources.getColorStateList(int): [0xB] can't resolve returned type 'Unresolved Reference: android.content.res.ColorStateList' or 'Reference: android.content.res.ColorStateList' Line 321233: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.content.res.ColorStateList com.tencent.shadow.core.runtime.MixResources.getColorStateList(int, android.content.res.Resources$Theme) failed to verify: android.content.res.ColorStateList com.tencent.shadow.core.runtime.MixResources.getColorStateList(int, android.content.res.Resources$Theme): [0xB] can't resolve returned type 'Unresolved Reference: android.content.res.ColorStateList' or 'Reference: android.content.res.ColorStateList' Line 321234: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawable(int) failed to verify: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawable(int): [0xB] can't resolve returned type 'Unresolved Reference: android.graphics.drawable.Drawable' or 'Reference: android.graphics.drawable.Drawable' Line 321235: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawable(int, android.content.res.Resources$Theme) failed to verify: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawable(int, android.content.res.Resources$Theme): [0xB] can't resolve returned type 'Unresolved Reference: android.graphics.drawable.Drawable' or 'Reference: android.graphics.drawable.Drawable' Line 321236: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawableForDensity(int, int) failed to verify: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawableForDensity(int, int): [0x11] can't resolve returned type 'Unresolved Reference: android.graphics.drawable.Drawable' or 'Reference: android.graphics.drawable.Drawable' Line 321237: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawableForDensity(int, int, android.content.res.Resources$Theme) failed to verify: android.graphics.drawable.Drawable com.tencent.shadow.core.runtime.MixResources.getDrawableForDensity(int, int, android.content.res.Resources$Theme): [0xB] can't resolve returned type 'Unresolved Reference: android.graphics.drawable.Drawable' or 'Reference: android.graphics.drawable.Drawable' Line 321238: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.graphics.Typeface com.tencent.shadow.core.runtime.MixResources.getFont(int) failed to verify: android.graphics.Typeface com.tencent.shadow.core.runtime.MixResources.getFont(int): [0xB] can't resolve returned type 'Unresolved Reference: android.graphics.Typeface' or 'Reference: android.graphics.Typeface' Line 321239: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.content.res.XmlResourceParser com.tencent.shadow.core.runtime.MixResources.getLayout(int) failed to verify: android.content.res.XmlResourceParser com.tencent.shadow.core.runtime.MixResources.getLayout(int): [0xB] can't resolve returned type 'Unresolved Reference: android.content.res.XmlResourceParser' or 'Reference: android.content.res.XmlResourceParser' Line 321240: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.graphics.Movie com.tencent.shadow.core.runtime.MixResources.getMovie(int) failed to verify: android.graphics.Movie com.tencent.shadow.core.runtime.MixResources.getMovie(int): [0xB] can't resolve returned type 'Unresolved Reference: android.graphics.Movie' or 'Reference: android.graphics.Movie' Line 321241: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.content.res.XmlResourceParser com.tencent.shadow.core.runtime.MixResources.getXml(int) failed to verify: android.content.res.XmlResourceParser com.tencent.shadow.core.runtime.MixResources.getXml(int): [0xB] can't resolve returned type 'Unresolved Reference: android.content.res.XmlResourceParser' or 'Reference: android.content.res.XmlResourceParser' Line 321242: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: java.io.InputStream com.tencent.shadow.core.runtime.MixResources.openRawResource(int) failed to verify: java.io.InputStream com.tencent.shadow.core.runtime.MixResources.openRawResource(int): [0xB] can't resolve returned type 'Unresolved Reference: java.io.InputStream' or 'Reference: java.io.InputStream' Line 321243: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: java.io.InputStream com.tencent.shadow.core.runtime.MixResources.openRawResource(int, android.util.TypedValue) failed to verify: java.io.InputStream com.tencent.shadow.core.runtime.MixResources.openRawResource(int, android.util.TypedValue): [0xB] can't resolve returned type 'Unresolved Reference: java.io.InputStream' or 'Reference: java.io.InputStream' Line 321244: 10-24 09:20:22.614 10400 28350 28372 E JavaBinder: android.content.res.AssetFileDescriptor com.tencent.shadow.core.runtime.MixResources.openRawResourceFd(int) failed to verify: android.content.res.AssetFileDescriptor com.tencent.shadow.core.runtime.MixResources.openRawResourceFd(int): [0xB] can't resolve returned type 'Unresolved Reference: android.content.res.AssetFileDescriptor' or 'Reference: android.content.res.AssetFileDescriptor' (declaration of 'com.tencent.shadow.core.runtime.MixResources' appears in /data/user/0/包名/files/ShadowPluginManager/UnpackedPlugin/xxx-sdk/7adba112ba9c7509995c995900b0f060/plugin.zip/sample-loader-release.apk)
问题确实都是在android 12上报的,询问部分用户是在升级OS后进入插件发生,但非必现。
如果能确定同一台设备在同一个版本的系统上没法稳定复现,甚至只复现了一次。那我们也许只能大胆的猜测是不是某些odex文件在系统升级前后出现了不兼容的情况。
我也遇到了这个问题,vivo 手机Android 12 启动插件,在插件界面显示的时候立即关闭应用就有概率触发。需要宿主直接启动插件后立即关闭。
java.lang.NoClassDefFoundError: com.demo.manager.SamplePluginManager at com.tencent.shadow.dynamic.impl.ManagerFactoryImpl.buildManager(ManagerFactoryImpl.kt:32) at com.tencent.shadow.dynamic.host.ManagerImplLoader.load(Unknown Source:41) at com.tencent.shadow.dynamic.host.DynamicPluginManager.updateManagerImpl(:3) at com.tencent.shadow.dynamic.host.DynamicPluginManager.enter(Unknown Source:36)
Caused by: java.lang.VerifyError: Rejecting class com.demo.manager.SamplePluginManager that attempts to sub-type erroneous class com.demo.manager.FastPluginManager (declaration of 'com.demo.manager.SamplePluginManager' appears in /data/user/0/com.demo.user/files/manager-release.apk)
从其他地方看到这个bug的原因,它和shadow没有关系。 https://www.51cto.com/article/700901.html
大数据统计中,在android 12的设备上,有以下的偶发性错误。 错误仅发生在android 12。 请教一下,能否帮忙提供一下解决思路? 非常感谢~
一个个人猜测是: 从
'Unresolved Reference: com.tencent.shadow.core.runtime.MixResources'
猜测可能是因为runtime的classloader出问题了?