singwhatiwanna / dynamic-load-apk

DL : dynamic load framework in android
http://blog.csdn.net/singwhatiwanna/article/details/40283117
Other
6.02k stars 2k forks source link

插件apk中含有tablayout,无法加载 #157

Open AndroidKiven opened 6 years ago

AndroidKiven commented 6 years ago

FATAL EXCEPTION: main Process: com.hotnews, PID: 31931 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hotnews/com.plugincore.proxycomponent.ProxyActivity}: android.view.InflateException: Binary XML file line #28: Error inflating class android.support.design.widget.TabLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614) at android.app.ActivityThread.access$800(ActivityThread.java:178) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5653) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) Caused by: android.view.InflateException: Binary XML file line #28: Error inflating class android.support.design.widget.TabLayout at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:421) at android.app.Activity.setContentView(Activity.java:2175) at com.plugincore.base.BasePluginActivity.setContentView(BasePluginActivity.java:51) at com.hotnewsapk.NewsInfoShowActivity.onCreate(NewsInfoShowActivity.java:70) at com.plugincore.proxycomponent.ProxyActivity.launchActivity(ProxyActivity.java:47) at com.plugincore.proxycomponent.ProxyActivity.onCreate(ProxyActivity.java:29) at android.app.Activity.performCreate(Activity.java:6100) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)  at android.app.ActivityThread.access$800(ActivityThread.java:178)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:194)  at android.app.ActivityThread.main(ActivityThread.java:5653)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)  Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.TabLayout" on path: DexPathList[[zip file "/data/app/com.hotnews-1/base.apk"],nativeLibraryDirectories=[/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.view.LayoutInflater.createView(LayoutInflater.java:571) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at android.view.LayoutInflater.inflate(LayoutInflater.java:365)  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:421)  at android.app.Activity.setContentView(Activity.java:2175)  at com.plugincore.base.BasePluginActivity.setContentView(BasePluginActivity.java:51)  at com.hotnewsapk.NewsInfoShowActivity.onCreate(NewsInfoShowActivity.java:70)  at com.plugincore.proxycomponent.ProxyActivity.launchActivity(ProxyActivity.java:47)  at com.plugincore.proxycomponent.ProxyActivity.onCreate(ProxyActivity.java:29)  at android.app.Activity.performCreate(Activity.java:6100)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)  at android.app.ActivityThread.access$800(ActivityThread.java:178)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:194)  at android.app.ActivityThread.main(ActivityThread.java:5653)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)  Suppressed: java.lang.ClassNotFoundException: android.support.design.widget.TabLayout 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) ... 26 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

并且我在插件apk的build中配置了: dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:support-v13:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.github.bumptech.glide:glide:3.7.0' compile 'com.squareup.okhttp3:okhttp:3.8.1' compile 'com.android.support:design:23.1.1' compile 'com.google.code.gson:gson:2.8.1' compile project(':plugincore') }

736870598 commented 6 years ago

请问解决了没有?我插件中的recyclerview在混淆后无法正常显示