ThanosFisherman / WifiUtils

Easily Connect to WiFi Networks
Apache License 2.0
731 stars 188 forks source link

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/thanosfisherman/elvis/Elvis; #85

Closed Aima09 closed 3 years ago

Aima09 commented 3 years ago

Hi guys,Does anybody have any idea for this crash issue? I test it on the sony device with android 9.

Process: com.rockchip.alexa.jacky, PID: 30110
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/thanosfisherman/elvis/Elvis;
        at com.thanosfisherman.wifiutils.WifiUtils$1.onWifiEnabled(WifiUtils.java:106)
        at com.thanosfisherman.wifiutils.WifiUtils.enableWifi(WifiUtils.java:242)
        at com.thanosfisherman.wifiutils.WifiUtils.start(WifiUtils.java:412)
        at com.rockchip.alexa.jacky.control.WifiControl.connect(WifiControl.java:343)
        at com.rockchip.alexa.jacky.async.AsyncThread$AsyncHandler.handleMessage(AsyncThread.java:53)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:280)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.thanosfisherman.elvis.Elvis" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.rockchip.alexa.jacky-W1Ct-it877QVrWZhwCGMYQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.rockchip.alexa.jacky-W1Ct-it877QVrWZhwCGMYQ==/lib/arm64, /data/app/com.rockchip.alexa.jacky-W1Ct-it877QVrWZhwCGMYQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.thanosfisherman.wifiutils.WifiUtils$1.onWifiEnabled(WifiUtils.java:106) 
        at com.thanosfisherman.wifiutils.WifiUtils.enableWifi(WifiUtils.java:242) 
        at com.thanosfisherman.wifiutils.WifiUtils.start(WifiUtils.java:412) 
        at com.rockchip.alexa.jacky.control.WifiControl.connect(WifiControl.java:343) 
        at com.rockchip.alexa.jacky.async.AsyncThread$AsyncHandler.handleMessage(AsyncThread.java:53) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:280) 
        at android.os.HandlerThread.run(HandlerThread.java:65) 
ThanosFisherman commented 3 years ago

Looks like this library is not imported correctly but I don't understand why.

Please try the following

  1. File > Sync Project with Gradle Files
  2. File > Invalidate Caches / Restart
Aima09 commented 3 years ago

Looks like this library is not imported correctly but I don't understand why.

Please try the following

  1. File > Sync Project with Gradle Files
  2. File > Invalidate Caches / Restart

Thanks for your reply,I have resolve this issue with add another library to the gradle and sync it.

implementation 'com.thanosfisherman.elvis:elvis:2.0'

spurdow commented 3 years ago

I didn't encounter this before and at that point in time I was using oracle JDK, now I'm using openJDK and I experienced this a lot.

Though I don't have proof that it is because of the JDK that I'm currently using but that is a possibility.

ThanosFisherman commented 3 years ago

@spurdow make sure you are using the latest version.