I upgraded to Android studio version 3.0 Canary 8 and followed the auto-prompt on Android studio to upgrade the android gradle plugin version to "3.0.0-alpha8".
My Jenkins build now fails to resolve "com.android.tools.build:gradle:3.0.0-alpha8.". Below are the build error logs
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
My root project build.gradle is as follows:
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'
}
}
Same code builds successfully on Android Studio, but fails on Jenkins
You must add this url in your repositories root build.gradle:
maven { url 'https://maven.google.com' }
Like this:
buildscript {
repositories {
jcenter()
mavenCentral() // add repository
maven { url 'https://maven.google.com' }
}
}
Regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With