Android Studio報錯:Didn‘t find class “XXXActivity“ on path
阿新 • • 發佈:2020-10-16
在執行專案的時候報錯:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.bj.xw/com.bj.xw.MainActivity}: java.lang.ClassNotFoundException: Didn’t find class “com.bj.xw.MainActivity” on path: DexPathList[[zip file “/data/app/com.bj.xw-2/base.apk”],nativeLibraryDirectories=[/data/app/com.bj.xw-2/lib/arm64, /vendor/lib64, /system/lib64]]
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.bj.xw.MainActivity” on path: DexPathList[[zip file “/data/app/com.bj.xw-2/base.apk”],nativeLibraryDirectories=[/data/app/com.snxun.bj.xw-2/lib/arm64, /vendor/lib64, /system/lib64]]
解決辦法:
開啟AndroidManifest.xml你一定會發現有標紅報錯的地方,是因為註冊Activity的路徑寫錯了,修改一下就好。