1. 程式人生 > >android studio 執行程式提示Application installation failed

android studio 執行程式提示Application installation failed

錯誤彈窗如圖:

Installation failed with message Failed to finalize session: INSTALL_FAILED_TEST_ONLY:installPackageLI.

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?

1.Clean Project之後再試,如果還不行就在模擬器上面解除安裝該app。

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,重新執行程式,大功告成。 

技術分享

我使用第一種方式,完美的解決了我自己的問題。