Flutter/Error
Flutter ) Didn't find class ".MainActivity" on path: DexPathList
EEYatHo
2024. 12. 30. 11:17
반응형
에러 현상
1. 안드로이드 빌드시 앱 실행하자마자 꺼짐
2. flutter run --verbose 실행시 아래 로그 발생
(요약: Didn't find class ".MainActivity" on path: DexPathList..)
12-30 10:21:45.820 I/Finsky ( 6261): [2] aaow.i(1): aaow - Received: android.intent.action.PACKAGE_REMOVED, [QYmj42YIe3QPu41ornIwGPfD2dX-4zb9YxrT9uk_QQ0]
[ +5 ms] executing: {사용자경로}/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
-f 0x20000000 --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true {번들ID}/{번들ID}.MainActivity
[+1059 ms] Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x20000000 cmp={번들ID}/.MainActivity (has extras) }
[ ] Waiting for VM Service port to be available...
[ +885 ms] E/AndroidRuntime(18103): FATAL EXCEPTION: main
[ ] E/AndroidRuntime(18103): Process: {번들ID}, PID: 18103
[ ] E/AndroidRuntime(18103): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{{번들ID}/{번들ID}.MainActivity}:
java.lang.ClassNotFoundException: Didn't find class "{번들ID}.MainActivity" on path: DexPathList[[zip file
"/data/app/~~chodHdiwX_vXWN-4Mast1w==/{번들ID}-AuYbYurjRh339K1YD_Aypg==/base.apk"],nativeLibraryDirectories=[/data/app/~~chodHdiwX_vXWN-4Mast1w==/{번들ID}
-AuYbYurjRh339K1YD_Aypg==/lib/arm64, /data/app/~~chodHdiwX_vXWN-4Mast1w==/{번들ID}-AuYbYurjRh339K1YD_Aypg==/base.apk!/lib/arm64-v8a, /system/lib64,
/system_ext/lib64]]
[ ] E/AndroidRuntime(18103): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3954)
[ ] E/AndroidRuntime(18103): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4235)
[ ] E/AndroidRuntime(18103): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:112)
[ ] E/AndroidRuntime(18103): at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:174)
[ ] E/AndroidRuntime(18103): at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:109)
[ ] E/AndroidRuntime(18103): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:81)
[ ] E/AndroidRuntime(18103): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2636)
[ ] E/AndroidRuntime(18103): at android.os.Handler.dispatchMessage(Handler.java:107)
[ ] E/AndroidRuntime(18103): at android.os.Looper.loopOnce(Looper.java:232)
[ ] E/AndroidRuntime(18103): at android.os.Looper.loop(Looper.java:317)
[ ] E/AndroidRuntime(18103): at android.app.ActivityThread.main(ActivityThread.java:8705)
[ ] E/AndroidRuntime(18103): at java.lang.reflect.Method.invoke(Native Method)
[ ] E/AndroidRuntime(18103): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
[ ] E/AndroidRuntime(18103): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
[ ] E/AndroidRuntime(18103): Caused by: java.lang.ClassNotFoundException: Didn't find class "{번들ID}.MainActivity" on path: DexPathList[[zip file
"/data/app/~~chodHdiwX_vXWN-4Mast1w==/{번들ID}-AuYbYurjRh339K1YD_Aypg==/base.apk"],nativeLibraryDirectories=[/data/app/~~chodHdiwX_vXWN-4Mast1w==/{번들ID}
-AuYbYurjRh339K1YD_Aypg==/lib/arm64, /data/app/~~chodHdiwX_vXWN-4Mast1w==/{번들ID}-AuYbYurjRh339K1YD_Aypg==/base.apk!/lib/arm64-v8a, /system/lib64,
/system_ext/lib64]]
[ +1 ms] E/AndroidRuntime(18103): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
[ ] E/AndroidRuntime(18103): at java.lang.ClassLoader.loadClass(ClassLoader.java:637)
[ ] E/AndroidRuntime(18103): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
[ ] E/AndroidRuntime(18103): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
[ ] E/AndroidRuntime(18103): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:44)
[ ] E/AndroidRuntime(18103): at android.app.Instrumentation.newActivity(Instrumentation.java:1448)
[ ] E/AndroidRuntime(18103): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3941)
[ ] E/AndroidRuntime(18103): ... 13 more
원인 및 해결방법
여러 원론적인 이유들이 있지만, 그냥 휴먼 에러로 발생
번들 ID를 바꿨지만,
app/src/main/kotlin에 있는 MainActivity.kt의 package를 변경하지 않아서 발생