本文主要是介绍关于广播报 RuntimeException : Didn't find class on path: DexPathList 等问题解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
关于广播报 RuntimeException : Didn’t find class on path: DexPathList
RuntimeException DexPathList ContentProvider
起因
项目升级了 compileSdkVersion版本从22 ->28 还有 *com.android.support. ** 等包
然后在低版本报错 如下
E/AndroidRuntime: FATAL EXCEPTION: mainjava.lang.RuntimeException: Unable to get provider me.jessyan.autosize.InitProvider: java.lang.ClassNotFoundException: Didn't find class "me.jessyan.autosize.InitProvider" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/2.apk"],nativeLibraryDirectories=[/data/app-lib/2, /vendor/lib, /system/lib, /system/lib/egl]]at android.app.ActivityThread.installProvider(ActivityThread.java:4882)at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485)at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425)at android.app.ActivityThread.access$1300(ActivityThread.java:141)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:137)at android.app.ActivityThread.main(ActivityThread.java:5103)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:525)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:773)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:589)at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.ClassNotFoundException: Didn't find class "me.jessyan.autosize.InitProvider" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/2.apk"],nativeLibraryDirectories=[/data/app-lib/2, /vendor/lib, /system/lib, /system/lib/egl]]at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)at java.lang.ClassLoader.loadClass(ClassLoader.java:501)at java.lang.ClassLoader.loadClass(ClassLoader.java:461)at android.app.ActivityThread.installProvider(ActivityThread.java:4867)at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:773) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:589) at dalvik.system.NativeStart.main(Native Method)
原因 multiDex 的问题
解决方式
1、在dependencies中增加
api 'com.android.support:multidex:1.0.2@aar'
2、在Application中增加
@Overrideprotected void attachBaseContext(Context base) {super.attachBaseContext(base);MultiDex.install(this);}
重新build 运行即可。
这篇关于关于广播报 RuntimeException : Didn't find class on path: DexPathList 等问题解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!