ClassNotFoundException在路径上找不到类:DexPathList

时间:2018-05-07 03:05:52

标签: android gradle android-gradle

我有我认为是dex问题的东西,这对我来说是非常陌生的。我的应用程序尝试实例化OkHttpClient时崩溃。我看到很多人都有这个问题,但所有常见的解决方案(我在下面提到)并没有帮助。这是我的错误日志:

dask

我看到有关启用多索引的多个解决方案,但我的应用已经启用了多索引,而且我的清单也将largeHeap设置为true。我也试过这个gradle解决方案,但它没有帮助:

05-06 22:43:27.912 8714-8714/com.clockwise.epochsoftware.clockwise E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.clockwise.epochsoftware.clockwise, PID: 8714
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/OkHttpClient;
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.getLatestRelease(ApplicationLoader.java:123)
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.init(ApplicationLoader.java:94)
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.onCreate(ApplicationLoader.java:250)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: okhttp3.OkHttpClient
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.getLatestRelease(ApplicationLoader.java:123) 
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.init(ApplicationLoader.java:94) 
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.onCreate(ApplicationLoader.java:250) 
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740) 
at android.app.ActivityThread.-wrap1(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/Call$Factory;
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.getLatestRelease(ApplicationLoader.java:123) 
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.init(ApplicationLoader.java:94) 
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.onCreate(ApplicationLoader.java:250) 
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740) 
at android.app.ActivityThread.-wrap1(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.Call$Factory" on path: DexPathList[[zip file "/data/app/com.clockwise.epochsoftware.clockwise-e7jhExlmJXSclbvr60izkA==/base.apk"],nativeLibraryDirectories=[/data/app/com.clockwise.epochsoftware.clockwise-e7jhExlmJXSclbvr60izkA==/lib/arm64, /data/app/com.clockwise.epochsoftware.clockwise-e7jhExlmJXSclbvr60izkA==/base.apk!/lib/arm64-v8a, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.getLatestRelease(ApplicationLoader.java:123) 
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.init(ApplicationLoader.java:94) 
at com.clockwise.epochsoftware.clockwise.ApplicationLoader.onCreate(ApplicationLoader.java:250) 
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740) 
at android.app.ActivityThread.-wrap1(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

其他解决方案说禁用即时运行,但它已被禁用。有人有什么建议吗?如果我需要在这篇文章中添加任何其他内容,请告诉我。

0 个答案:

没有答案