This Gradle plugin requires a newer IDE able to request IDE model level 3.For Android Studio this me...
导入一个项目,一开始是显示这个错误的:
Gradle project sync failed. Please fix your project and try again.
build.gradle文件中的buildToolsVersion 的版本与当前环境的版本不一致
一开始我以为是gradle版本不一致导致的问题,于是乎对 gradle 的各个 version 改改改,改来改去还是显示这个错误。
改完后需要sync now
网上有博主写过教程,如果sync now没有效果,则需要选择sync project with gradle files 让AS跑一下。这个功能栏自 AS 2.2就改到了 File 目录下。
代码还是要多练呐(捂脸),完事后,错误提示变成了This Gradle plugin requires a newer IDE able to request IDE model level 3.For Android Studio this means version 3.0+
As版本太低,gradle 不能 build 成功,Gradle插件需要一个更新的IDE,需要我升级 AS 到 3.0 以上。
升级很花时间
懒得下载新版本?那就在项目gradle.properties中添加以下一行:指定构建是使用的model
android.injected.build.model.only.versioned = 3
不过这个指标不治本啊,还是升级一下 AS 最好不过,一劳永逸。