1.Minimum supported Gradle version is 4.1. Current version is 4.0.1
各方面的配置都是正确的,在terminal中调用命令gradle assemble,总是报这个错误,找不到原因
E:\direct\as\Bingo>gradle assemble
* Where:
Build file 'E:\direct\as\Bingo\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Minimum supported Gradle version is 4.1. Current version is 4.0.1. If using the gradle wrapper, try editing the distributionUrl in E:\direct\as\Bingo\gradle\wrapper\gradle-wrapper.properties to gradle-4.1-all.zip
最后试了一下
E:\direct\as\Bingo>gradle -version
------------------------------------------------------------
Gradle 4.0.1
------------------------------------------------------------
Build time: 2017-07-07 14:02:41 UTC
Revision: 38e5dc0f772daecca1d2681885d3d85414eb6826
Groovy: 2.4.11
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)
OS: Windows 8.1 6.3 amd64
E:\direct\as\Bingo>gradlew -version
------------------------------------------------------------
Gradle 4.4
------------------------------------------------------------
Build time: 2017-12-06 09:05:06 UTC
Revision: cf7821a6f79f8e2a598df21780e3ff7ce8db2b82
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)
OS: Windows 8.1 6.3 amd64
原来是因为配置了环境变量(windows),所以,以后还是不要配置gradle的环境变量了,用项目根目录底下的gradlew命令就好
2.Could not find com.android.tools.build:gradle:3.1.1
* What went wrong:
A problem occurred configuring root project 'MLottery'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.1.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.1/gradle-3.1.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.1/gradle-3.1.1.jar
Required by:
project :
gradle新版本需要依赖google()仓库
android支持库的新版本也需要google()仓库