Android IDE (AIDE) Support Forum

Didn't find class? How to fix?

  • source: https://github.com/NickMckloski/libgdx-rpg
  • log: FATAL EXCEPTION: main
    Process: com.nickm.rpg, PID: 21919
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.nickm.rpg/com.nickm.rpg.MainActivity}: java.lang.ClassNotFoundException: Didn’t find class “com.nickm.rpg.MainActivity” on path: DexPathList[[zip file “/system/framework/org.apache.http.legacy.boot.jar”, zip file “/data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/base.apk”],nativeLibraryDirectories=[/data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/lib/arm, /system/fake-libs, /data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/base.apk!/lib/armeabi-v7a, /system/lib]]
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3099)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1829)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:215)
    at android.app.ActivityThread.main(ActivityThread.java:6910)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
    Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.nickm.rpg.MainActivity” on path: DexPathList[[zip file “/system/framework/org.apache.http.legacy.boot.jar”, zip file “/data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/base.apk”],nativeLibraryDirectories=[/data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/lib/arm, /system/fake-libs, /data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/base.apk!/lib/armeabi-v7a, /system/lib]]
    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 android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
    at android.app.Instrumentation.newActivity(Instrumentation.java:1234)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2882)
    … 11 more
    Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/base.apk because: Failure to verify dex file ‘/data/app/com.nickm.rpg-J5jY1IroI7NhZ_X4ekE1iw==/base.apk’: unexpected static field initial value type: ‘L’ vs ‘J’
    at dalvik.system.DexFile.openDexFileNative(Native Method)
    at dalvik.system.DexFile.openDexFile(DexFile.java:354)
    at dalvik.system.DexFile.(DexFile.java:101)
    at dalvik.system.DexFile.(DexFile.java:75)
    at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
    at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
    at dalvik.system.DexPathList.(DexPathList.java:164)
    at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:74)
    at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:65)
    at dalvik.system.PathClassLoader.(PathClassLoader.java:64)
    at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
    at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
    at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
    at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
    at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:731)
    at android.app.LoadedApk.getClassLoader(LoadedApk.java:814)
    at android.app.LoadedApk.getResources(LoadedApk.java:1036)
    at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5956)

This happens with me, i dont remember how i fix it.

I dont know if this would work but I would recommend starting a new project and copy-paste your codes in the new project.

This is strange. or the aide is not strong enough to build

this happen if the support lib you use containing java8 code or the lib was builded with java8.i.m facing this issue and stuck to fix it due to aide limit to compile correctly when we use some new androidx lib or support 28.looks like aide is going to dig their own grave.2 years more java8 already release and aide still not support it.kinda disappointing.

Any solution? Please!

This happen with me since the two latest updates.

So onr solution is to compile with Java 10 (using Termux)

what do you mean? can you give some example compile using termux?

Thr process of how to do is really big, so i will guide you to this link

1 Like