Instant Run 的操作影響到了代碼,導致Android App啟動閃退的問題
轉自yuhc163原文android啟動應用java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack tra
在android studio 點擊RUN運行應用APP,可以正常運行,但是將生成有APK,用adb install到系統,提示APP已經安裝成功
但是運行應用就提示**應用已經停止運行,看log發現如下的信息
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Caused by: java.lang.ClassNotFoundException: Didn‘t find class "com.tct.weather.provider.WeatherContentProvider"
java.lang.RuntimeException: Unable to get provider com.tct.weather.provider.WeatherContentProvider: java.lang.ClassNotFoundException: Didn‘t find class "com.tct.weat
明明已經安裝了應用為會什麽會找不到類?同時android studio 點擊RUN是可以正常運行的,APP沒什麽問題,後續查找資料,找到了原因:
在Android Studio 2.3 或者更高版本,有個 Instant Run 的操作影響到了我們的代碼,需要disable
Disable Instant Run 的方法如下:
File -> Settings -> Build, Execution, Deployment -> Instant Run
Instant Run 的操作影響到了代碼,導致Android App啟動閃退的問題