Could not find com.android.tools.build:gradle:2.14.1.

 

dependencies {
    classpath 'com.android.tools.build:gradle:2.14.1'
}

使用2.14.1版本gradle 结果显示无法找到。

Error:A problem occurred configuring root project 'Client'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:2.14.1.
     Searched in the following locations:
         file:/D:/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.pom
         file:/D:/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.jar
         https://jcenter.bintray.com/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.pom
         https://jcenter.bintray.com/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.jar
         https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.pom
         https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.14.1/gradle-2.14.1.jar
     Required by:
         :Client:unspecified


打开D:\Android Studio\gradle\m2repository\com\android\tools\build\gradle目录发现只有

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.2'
}

将引用改为2.2.2版本后又提示版本过低

Error:(1, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 2.14.1. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in D:\UUHOO\Assistant\AndroidClient\Client\gradle\wrapper\gradle-wrapper.properties to gradle-2.14.1-all.zip


Could not find com.android.tools.build:gradle:2.14.1._第1张图片


最后使用2.2.2版本  在cmd里根目录输入gradle build 手动编译成功


更新

Could not find com.android.tools.build:gradle:2.14.1._第2张图片

只要在设置里面设置本地目录不使用gradle wrapper就不会提示版本过低的问题了

你可能感兴趣的:(gradle)