Installation failed with message INSTALL_FAILED_TEST_ONLY. 安卓程序无法安装到手机,提示可能已经安装过

Installation failed with message INSTALL_FAILED_TEST_ONLY. 安卓程序无法安装到手机,提示可能已经安装过
在这里插入图片描述错误提示如图

三种解决方法

第一种

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.打开Run–Edit Configurations
2.在Install Flags中写上“-t”
3.点击Apply–OK,重新运行程序

如图
在这里插入图片描述

第三种

1.打开Gradle Scripts–gradle.properties
2.添加一句android.injected.testOnly=false

如图
在这里插入图片描述

这是目前我收集到三种方法,希望有用

。。。。。。。第一次写博客,不是很明白,有错误的地方请大家批评指正

发布了2 篇原创文章 · 获赞 0 · 访问量 19

猜你喜欢

转载自blog.csdn.net/weixin_44980584/article/details/105293530