詹金斯无法解决com.android.tools.build:gradle:3.0.0-alpha8

时间:2017-07-25 01:46:27

标签: android android-studio jenkins android-gradle gradle-plugin

我升级到Android工作室版本3.0 Canary 8并按照Android工作室的自动提示将android gradle插件版本升级到" 3.0.0-alpha8"。

我的Jenkins构建现在无法解决" com.android.tools.build:gradle:3.0.0-alpha8。"。以下是构建错误日志

Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.0-alpha8.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha8/gradle-3.0.0-alpha8.pom      
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha8/gradle-3.0.0-alpha8.jar
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.0-alpha8/gradle-3.0.0-alpha8.pom         https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.0-alpha8/gradle-3.0.0-alpha8.jar        https://maven.fabric.io/public/com/android/tools/build/gradle/3.0.0-alpha8/gradle-3.0.0-alpha8.pom        https://maven.fabric.io/public/com/android/tools/build/gradle/3.0.0-alpha8/gradle-3.0.0-alpha8.jar

我的根项目build.gradle如下:

buildscript {
repositories {
    jcenter()
    google() 
    // maven { url "https://maven.google.com" } does not work as well
    maven { url 'https://maven.fabric.io/public' }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha8'
    classpath 'com.google.gms:google-services:3.1.0'
    classpath 'io.fabric.tools:gradle:1.23.0'
}
}

相同的代码在Android Studio上成功构建,但在Jenkins上失败

1 个答案:

答案 0 :(得分:15)

您必须在存储库root build.gradle中添加此URL:

.fxml

像这样:

    maven { url 'https://maven.google.com' }

此致