Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

异常java.lang.ClassNotFoundException: com.testreplugin.loader.p.ProviderN1 #51

Closed
ikakaxi opened this issue Jul 2, 2017 · 2 comments

Comments

@ikakaxi
Copy link

ikakaxi commented Jul 2, 2017

插件问题:异常
java.lang.ClassNotFoundException: com.testreplugin.loader.p.ProviderN1

我的代码上传到了github:https://github.com/ikakaxi/testRePlugin.git

我是app->lib1->lib2
lib1和lib2有一个相同名字的color资源,然后在app里默认的activity_main里面把文字颜色设置了这个color,运行报错

详细堆栈信息:
java.lang.RuntimeException: Unable to get provider com.testreplugin.loader.p.ProviderN1: java.lang.ClassNotFoundException: Didn't find class "com.testreplugin.loader.p.ProviderN1" on path: DexPathList[[zip file "/data/app/com.testreplugin-2/base.apk", zip file "/data/app/com.testreplugin-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.testreplugin-2/lib/x86_64, /vendor/lib64, /system/lib64]] at android.app.ActivityThread.installProvider(ActivityThread.java:5156) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.testreplugin.loader.p.ProviderN1" on path: DexPathList[[zip file "/data/app/com.testreplugin-2/base.apk", zip file "/data/app/com.testreplugin-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.testreplugin-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.testreplugin-2/lib/x86_64, /vendor/lib64, /system/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.ActivityThread.installProvider(ActivityThread.java:5141) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)  at android.app.ActivityThread.-wrap1(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Suppressed: java.lang.ClassNotFoundException: com.testreplugin.loader.p.ProviderN1 at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

@jiongxuan
Copy link
Contributor

jiongxuan commented Jul 2, 2017

您好,通常遇到这个问题是因为没有在Application中调用RePlugin.App.attachBaseContext等导致。

我看了下您的工程,确实没有调用相关方法。

请严格按照“主程序接入指南”所述来完成接入。插件亦是如此。

@ikakaxi
Copy link
Author

ikakaxi commented Jul 2, 2017

解决了,非常感谢,新建的项目忘了写RePlugin.App.attachBaseContext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants