Tencent / Shadow

零反射全动态Android插件框架
BSD 3-Clause "New" or "Revised" License
7.47k stars 1.31k forks source link

PluginLoaderImpl类加载器出现java.lang.LinkageError #1322

Closed AndroidMuggle closed 7 months ago

AndroidMuggle commented 7 months ago

java.lang.LinkageError: Class com.tencent.shadow.dynamic.loader.impl.LoaderFactoryImpl method com.tencent.shadow.dynamic.host.PluginLoaderImpl com.tencent.shadow.dynamic.loader.impl.LoaderFactoryImpl.buildLoader(java.lang.String, android.content.Context) resolves differently in interface com.tencent.shadow.dynamic.host.LoaderFactory: Return types mismatch: java.lang.Class<com.tencent.shadow.dynamic.host.PluginLoaderImpl,dalvik.system.PathClassLoader>(0x12d04da0) vs java.lang.Class<com.tencent.shadow.dynamic.host.PluginLoaderImpl,com.tencent.shadow.dynamic.host.DynamicRuntime$RuntimeClassLoader>(0x12e85bf8) (declaration of 'com.tencent.shadow.dynamic.loader.impl.LoaderFactoryImpl' appears in /data/user/0/com.example.launcherhost/files/ShadowPluginManager/UnpackedPlugin/test-dynamic-manager/65f7bbbacefdad660ca42eaa8b7549a5/plugin-debug.zip/launcherloader-debug.apk) at java.lang.Class.newInstance(Native Method) at com.tencent.shadow.dynamic.apk.ApkClassLoader.getInterface(ApkClassLoader.java:112) at com.tencent.shadow.dynamic.host.LoaderImplLoader.load(LoaderImplLoader.java:50) at com.tencent.shadow.dynamic.host.PluginProcessService.loadPluginLoader(PluginProcessService.java:150) at com.tencent.shadow.dynamic.host.PpsBinder.onTransact(PpsBinder.java:70) at android.os.Binder.transact(Binder.java:692) at com.tencent.shadow.dynamic.host.PpsController.loadPluginLoader(PpsController.java:60) at com.tencent.shadow.dynamic.manager.PluginManagerThatUseDynamicLoader.loadPluginLoader(PluginManagerThatUseDynamicLoader.java:107) at com.example.launchermanager.FastPluginManager.loadPluginLoaderAndRuntime(FastPluginManager.java:131) at com.example.launchermanager.FastPluginManager.loadPlugin(FastPluginManager.java:135) at com.example.launchermanager.SamplePluginManager$1.run(SamplePluginManager.java:122) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) 以上是堆栈信息,麻烦大佬看看这个类加载器异常,可能是哪个地方配置错了么(manager和loader对应的Factory包名是按照示例里面要求的配置的)