最佳答案
我更新了 gradle 插件到最新版本: com.android.tools.build:gradle:3.0.0-alpha1
,这个错误发生在 AS:
export TERM="dumb"
if [ -e ./gradlew ]; then ./gradlew test;else gradle test;fi
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'Android-app'. Could not
resolve all dependencies for configuration ':classpath'. Could not
find com.android.tools.build:gradle:3.0.0-alpha1. Searched in the
following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.jar
Required by:
当前 CI 配置 circle.yml
dependencies:
pre:
- mkdir -p $ANDROID_HOME"/licenses"
- echo $ANDROID_SDK_LICENSE > $ANDROID_HOME"/licenses/android-sdk-license"
- source environmentSetup.sh && get_android_sdk_25
cache_directories:
- /usr/local/android-sdk-linux
- ~/.android
- ~/.gradle
override:
- ./gradlew dependencies || true
test:
post:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
machine:
java:
version: oraclejdk8
编辑: 我的档案:
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath 'com.google.gms:google-services:3.0.0'
classpath "io.realm:realm-gradle-plugin:3.1.3"
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}