java.lang.NoClassDefFoundError while using android.location.GnssAntennaInfo - android

I am trying to run GnssAntennaInfo. Everything runs fine with on the emulator.
When testing on real devices (sdk 27), the app crashes with the following error:
2020-11-23 10:57:59.470 1203-1203/com.example.axpapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.axpapp, PID: 1203
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/location/GnssAntennaInfo;
at com.example.axpapp.GNSSTests.getAntennaInfo(GNSSTests.kt:8)
at com.example.axpapp.GNSSTests$Companion.printAntennaInfo(GNSSTests.kt:15)
at com.example.axpapp.MainActivity.onCreate(MainActivity.kt:11)
at android.app.Activity.performCreate(Activity.java:7258)
at android.app.Activity.performCreate(Activity.java:7249)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1222)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3059)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.location.GnssAntennaInfo" on path: DexPathList[[zip file "/data/app/com.example.axpapp-q_DcCIhOmXK9bQRnVIC0NA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.axpapp-q_DcCIhOmXK9bQRnVIC0NA==/lib/arm, /system/lib, /system/vendor/lib]]
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.example.axpapp.GNSSTests.getAntennaInfo(GNSSTests.kt:8) 
at com.example.axpapp.GNSSTests$Companion.printAntennaInfo(GNSSTests.kt:15) 
at com.example.axpapp.MainActivity.onCreate(MainActivity.kt:11) 
at android.app.Activity.performCreate(Activity.java:7258) 
at android.app.Activity.performCreate(Activity.java:7249) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1222) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3059) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:7000) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408) 
GNSSTest.kt as follow:
package com.example.axpapp
import android.location.GnssAntennaInfo
class GNSSTests {
fun getAntennaInfo(): String {
val antenna = GnssAntennaInfo.CREATOR
return antenna.toString()
}
companion object {
fun printAntennaInfo(){
println(GNSSTests().getAntennaInfo())
}
}
}
What is the reason for this crash? How can it be fixed?

Edit the build path in this order:
Make sure the /gen is before /src

Also, you can try to do next steps:
Clean project
Invalidate and restart
It worked too for me.

Related

AGP 7.2 - java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_3570298/Offline; for instrumentation tests

When running android instrumentation tests with AGP 7.2 (android studio chipmunk) I am seeing the following error:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_b6258fc/Offline;
at androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.$jacocoInit(Unknown Source:13)
at androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.<clinit>(Unknown Source:0)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
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 "org.jacoco.agent.rt.internal_b6258fc.Offline" on path: DexPathList[[zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.abc.appname.develop.test-VAV8qDGNBpOvARX_Y9h_SA==/base.apk"],nativeLibraryDirectories=[/data/app/com.abc.appname.develop.test-VAV8qDGNBpOvARX_Y9h_SA==/lib/x86, /system/lib, /vendor/lib]]
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 androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.$jacocoInit(Unknown Source:13) 
at androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.<clinit>(Unknown Source:0) 
at java.lang.Class.newInstance(Native Method) 
at android.app.Instrumentation.newActivity(Instrumentation.java:1174) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
I have jacoco 0.8.8 setup as well, but when I turn debug.testCoverageEnabled to false, the instrumentation tests pass successfully.
Using jacoco 0.8.7 has the same issue, but both 0.8.7 and 0.8.8 work correctly on AGP 7.1.3 (bumblebee).

How to solve a problem which causes app to crash when new dependency is added to gradle?

I am trying to integrate paynow api to my application, I have not done much, so far I have just added this dependance to gradle: implementation 'zw.co.paynow:java-sdk:1.1.1'
Supprisingly the app crashes, if I remove it the app does not crash, so adding it is crashing my app. So my question is, what could be missing that causes this crash?
logcat:
2021-06-11 19:32:31.825 25519-25519/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2021-06-11 19:32:31.829 25519-25519/? E/libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
2021-06-11 19:32:32.655 25519-25519/com.coin.cryptobase E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.coin.cryptobase, PID: 25519
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.coin.cryptobase/com.coin.cryptobase.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.coin.cryptobase.MainActivity" on path: DexPathList[[zip file "/data/app/com.coin.cryptobase-faku93JC1CyPtG_PsAGmrA==/base.apk"],nativeLibraryDirectories=[/data/app/com.coin.cryptobase-faku93JC1CyPtG_PsAGmrA==/lib/arm, /system/lib, /system/vendor/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2841)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6942)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.coin.cryptobase.MainActivity" on path: DexPathList[[zip file "/data/app/com.coin.cryptobase-faku93JC1CyPtG_PsAGmrA==/base.apk"],nativeLibraryDirectories=[/data/app/com.coin.cryptobase-faku93JC1CyPtG_PsAGmrA==/lib/arm, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1181)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2831)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6942) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 
Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.coin.cryptobase-faku93JC1CyPtG_PsAGmrA==/base.apk because: Failure to verify dex file '/data/app/com.coin.cryptobase-faku93JC1CyPtG_PsAGmrA==/base.apk': Bad method handle type 7
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:353)
at dalvik.system.DexFile.<init>(DexFile.java:100)
at dalvik.system.DexFile.<init>(DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.<init>(DexPathList.java:157)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:678)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:711)
at android.app.LoadedApk.getResources(LoadedApk.java:944)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2303)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5943)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
... 6 more
First clean the project, then invalidate android studio from File -> Invalidate Caches / Restart.. -> Invalidate and Restart.

RxJava 3.0.0 crashes a default Empty Activity project?

I create a new project in Android Studio 3.6 with default Empty Activity.
By just adding this to my gradle, sync and compile,
implementation "io.reactivex.rxjava3:rxjava:3.0.0"
The example app fail to even start, and crash as below
2020-03-09 21:47:15.448 12193-12193/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.elyeproj.myapplication, PID: 12193
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.elyeproj.myapplication/com.elyeproj.myapplication.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.elyeproj.myapplication.MainActivity" on path: DexPathList[[zip file "/data/app/com.elyeproj.myapplication-DiXzq-aNWvgVfrGsWCptJQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.elyeproj.myapplication-DiXzq-aNWvgVfrGsWCptJQ==/lib/x86, /system/lib, /vendor/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2718)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.elyeproj.myapplication.MainActivity" on path: DexPathList[[zip file "/data/app/com.elyeproj.myapplication-DiXzq-aNWvgVfrGsWCptJQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.elyeproj.myapplication-DiXzq-aNWvgVfrGsWCptJQ==/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1173)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2708)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6541) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.elyeproj.myapplication-DiXzq-aNWvgVfrGsWCptJQ==/base.apk because: Failure to verify dex file '/data/app/com.elyeproj.myapplication-DiXzq-aNWvgVfrGsWCptJQ==/base.apk': Bad method handle type 8
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:353)
at dalvik.system.DexFile.<init>(DexFile.java:100)
at dalvik.system.DexFile.<init>(DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.<init>(DexPathList.java:157)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:676)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:709)
at android.app.LoadedApk.getResources(LoadedApk.java:936)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2242)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5672)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
... 6 more
Is this expected (i.e. I miss something), or is it a bug?
Note, adding implementation "io.reactivex.rxjava2:rxjava:2.2.18" compiles fine.
You need to use Android Studio 4.0 or newer (and more importantly, AGP 4.0 or newer) to use RxJava3 in Android projects, because that is what adds the new desugaring capabilities that RxJava3 relies on.

FATAL EXCEPTION: java.lang.ClassNotFoundException: Didn't find class "MainAcitivity" on path: DexPathList

I have searched extensively to find a solution for this issue and tried what I see has been suggested in the past.
Things I tried:
Deleted *.iml files locally
Deleted .idea files locally
Removed the project
Closed Android Studio and re-imported
Invalidated cached
Cleaned and re-builded.
I'm assuming what caused the problem is moving MainActivity to a newly created package. Any suggestions would be greatly appreciated.
2019-02-23 17:04:15.948 5842-5842/com.ssowens.android.myweatherapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ssowens.android.myweatherapp, PID: 5842
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ssowens.android.myweatherapp/com.ssowens.android.myweatherapp.ui.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.ssowens.android.myweatherapp.ui.MainActivity" on path: DexPathList[[zip file "/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/base.apk"],nativeLibraryDirectories=[/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/lib/x86, /system/lib, /vendor/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2718)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ssowens.android.myweatherapp.ui.MainActivity" on path: DexPathList[[zip file "/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/base.apk"],nativeLibraryDirectories=[/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1173)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2708)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6541) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 

ClassNotFoundException Didn't find class on path: DexPathList

I'm having what I believe to be dex issues, which is something pretty foreign to me. My app crashes when it tries to instantiate an OkHttpClient. I see that a lot of people have this issue, but all the common solutions (which I mention below) haven't helped. Here's my error log:
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) 
I see multiple solutions about enabling multidexing, but my app already has multidexing enabled and my manifest also has largeHeap set to true. I've also tried this gradle solution, but it hasn't helped:
dexOptions{
preDexLibraries false
javaMaxHeapSize "4g"
}
Other solutions say to disable instant run, but it's already disabled. Anyone have any suggestions? Please let me know if I need to add anything else to this post.

Categories

Resources