Android

Caused by: java.lang.ClassNotFoundException: Didn’t find class “xxx.MainActivity” on path: DexPathList

알 수 없는 오류로 머리가 터질 것 같다. 잘 되던 것이 안드로이드 스튜디오 버전 업 하면서 오류 발생중이다.

PackageManager.DexOptimizer: Well this is awkward; package com.myApp.PowerManagementApplication had UID -1

java.lang.Throwable at com.android.server.pm.PackageDexOptimizer.performDexOptLI(PackageDexOptimizer.java:148)

at com.android.server.pm.PackageDexOptimizer.performDexOpt(PackageDexOptimizer.java:123)

at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:19375)

at com.android.server.pm.PackageManagerService.installPackageTracedLI(PackageManagerService.java:18920)

at com.android.server.pm.PackageManagerService.-wrap35(Unknown Source:0)

at com.android.server.pm.PackageManagerService$6.run(PackageManagerService.java:16179)

at android.os.Handler.handleCallback(Handler.java:789)

at android.os.Handler.dispatchMessage(Handler.java:98)

at android.os.Looper.loop(Looper.java:164)

at android.os.HandlerThread.run(HandlerThread.java:65)

at com.android.server.ServiceThread.run(ServiceThread.java:46)

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.myApp/com.myApp.MainActivity}: java.lang.ClassNotFoundException: Didn’t find class “com.myApp.MainActivity” on path: DexPathList[[zip file “/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/base.apk”, zip file “/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/split_lib_resources_apk.apk”, zip file “/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/split_lib_slice_0_apk.apk”],nativeLibraryDirectories=[/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/lib/arm64, /system/lib64, /vendor/lib64]]

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2771)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2950)

at android.app.ActivityThread.-wrap11(Unknown Source:0)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)

at android.os.Handler.dispatchMessage(Handler.java:105)

at android.os.Looper.loop(Looper.java:164)

at android.app.ActivityThread.main(ActivityThread.java:6759)

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:770)

 

 Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.myApp.MainActivity” on path: DexPathList[[zip file “/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/base.apk”, zip file “/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/split_lib_resources_apk.apk”, zip file “/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/split_lib_slice_0_apk.apk”],nativeLibraryDirectories=[/data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/lib/arm64, /system/lib64, /vendor/lib64]]

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:1174)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2761)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2950)

at android.app.ActivityThread.-wrap11(Unknown Source:0) 

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616) 

at android.os.Handler.dispatchMessage(Handler.java:105) 

at android.os.Looper.loop(Looper.java:164) 

at android.app.ActivityThread.main(ActivityThread.java:6759) 

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:770) 

Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.myApp-YWy-7D6-AQAkeA5Y0T_huw==/split_lib_resources_apk.apk

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:46)

at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)

at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36)

at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:736)

at android.app.LoadedApk.getClassLoader(LoadedApk.java:769)

at android.app.LoadedApk.getResources(LoadedApk.java:996)

at android.app.ContextImpl.createAppContext(ContextImpl.java:2243)

at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5868)

at android.app.ActivityThread.-wrap1(Unknown Source:0)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1684)

 

ClassNotFoundException: Didn’t find class 오류해결 방법

1.File-Settings 메뉴를 클릭한다.

2.Build,Execution, Deployment  – Instant Run 메뉴를 클릭한다.

3. Enable Instant Run to hot swap code/resource changes on deploy(default enable) 해제 한다.

Leave a Reply

error: Content is protected !!