前言:公司用的是3.0的版本自己电脑装的是2.2.2版本的,导入项目Gradle报错,以前也遇到过,时间原因忘记怎么解决了,于是google了一下解决了,特此以博客记录一下.
Error:This Gradle plugin requires Studio 3.0 minimum
错误:Gradle插件要求3.0的
加入这行代码 android.injected.build.model.only.versioned=3
按照以上步骤Gradle插件问题解决了,运行时又报错.如下图:
Installation failed with message INSTALL_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.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
不管你点取消还是ok都提示安装不成功,如下图结果
解决办法:还是在gradle.properties文件添加android.injected.testOnly=false
加上 android.injected.testOnly=false
然后问题解决,项目可以正常运行在手机上了,又可以愉快的玩耍了…
---------------------
原文:https://blog.csdn.net/qq_34581102/article/details/79592146