Android Studio 编译的时候报以下错误:
- What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.android.application']
Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in /Users/tuo3/git/H5F5FDBE7/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip
实际上提示已经很明显了,需要更新Gradle版本为2.10
解决办法:
Windows下:
** File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path **
Mac OS下:
** Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home **
或者我们可以修改工程目录下的gradle-wrapper.properties文件,例如你的工程\gradle\wrapper\gradle-wrapper.properties
然后添加下面的一行:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
网友评论