Failed to install app-debug.apk: Failure [-99]

6,273 阅读1分钟

Failed to install app-debug.apk: Failure [-99]

用的oppo R11 Android 7.1.1系统,然后在Android studio 3.0.1中安装app,一直报错。错误提示为
Application Installation Failed

Intallation failed with message INSTALL_FAILED_FAILED_TEST_ONLY. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present,and then re-installing.
查了自己的手机确定没有该app之前版本的。
解决方法:在gradle.properties中加入android.injected.testOnly=false
这行代码。原因就是Android studio3.0会默认自动添加 android:testOnly="true"导致安装失败。
参考资料:https://www.jianshu.com/p/3d73fb0d138f