Instant Run 的操作影響到了代碼,導致Android App啟動閃退的問題

來源:互聯網
上載者:User

標籤:trace   mono   boot   img   dex   tar   col   找不到類   ons   

 轉自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啟動閃退的問題

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.