1. 程式人生 > >Android Installation failed with message...It is possible that this issue is resolved by uninstalli

Android Installation failed with message...It is possible that this issue is resolved by uninstalli

1.今天一個朋友問我這樣一個錯誤,資訊和圖如下:

Installation failed with message...It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?


其實執行過程中遇到的錯誤(無法正常執行到手機或模擬器上),一般就是手機許可權設定問題和開發工具設定的問題了,下面來看看Studio中的設定,手機上的USB許可權就不說了,你懂的:

2.解決方法:

1、開啟選單File——Settings——Build,Execution,Deployment——Instant Run
2、不選中Enable Instant Run to hot swap code/resource changes on deploy(default enabled)

3、依次點選Apply——OK,重新執行程式,大功告成


如果你沒有成功,接下來使用第二招:
1、開啟Edit Configurations...
2、在Install Flags中寫上“-t”

3、依次點選Apply——OK,重新執行就可以了


一般情況下上面的兩步就可以搞定的