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

技术分享

我使用第一种方式,完美的解决了我自己的问题。

猜你喜欢

转载自blog.csdn.net/x_uhen/article/details/80562115