本文介绍了无法更新到 Android Studio gradle 1.4 插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 build.gradle
中,我有:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.4.+'
}
}
但是我得到:
Error:Could not find com.android.tools.build:gradle:1.4.+.
Searched in the following locations:
file:/C:/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.pom
file:/C:/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.jar
Required by:
:xxx:unspecified
怎么办?
推荐答案
这是因为 android 1.4.+ 的 gradle 插件不存在(当前)在中央专家.
It happens because the gradle plugin for android 1.4.+ doesn't exist (currently) in central maven.
你可以查看这里是中央 Maven 上可用版本的完整列表.
使用最新的稳定版本:
classpath 'com.android.tools.build:gradle:1.3.1'
如果你想使用测试版,你必须使用jcenter和
If you want to use the beta version you have to use jcenter and
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.4.0-beta6'
}
}
这里是 jcenter 完整列表.
编辑 03/11/2015
此外,beta 插件 1.5.x 仅适用于 jcenter.
EDIT 03/11/2015
Also the beta plugin 1.5.x is only on jcenter.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0-beta1'
}
}
这篇关于无法更新到 Android Studio gradle 1.4 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!