我在bitrise CI中遇到以下错误,尽管该构建工作可以在本地找到。我未对gradle文件进行任何更改,但它们突然停止在bitrise CI中工作
A problem occurred configuring root project 'src'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.google.gms:google-services:3.2.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
https://maven.google.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://maven.google.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
file:/root/.m2/repository/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
file:/root/.m2/repository/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
https://maven.fabric.io/public/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://maven.fabric.io/public/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
https://jcenter.bintray.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://jcenter.bintray.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
Required by:
project :
但是./gradlew assembleDebug
在本地工作正常。
分级项目:
buildscript {
repositories {
google()
maven { url 'https://maven.google.com' }
maven { url 'https://dl.google.com/dl/android/maven2' }
mavenLocal()
maven { url 'https://maven.fabric.io/public' }
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.25.1'
}
}
allprojects {
repositories {
def androidHome = System.getenv("ANDROID_HOME")
maven { url "$androidHome/extras/android/m2repository" }
google()
maven { url "https://maven.google.com" }
maven { url 'https://dl.google.com/dl/android/maven2' }
mavenLocal()
maven { url "http://repo.commonsware.com.s3.amazonaws.com" }
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
}
}
分级应用:
apply plugin: 'com.google.gms.google-services'
这是怎么了?
答案 0 :(得分:2)
com.google.gms.google-services 刚从Google存储库中消失(位于https://dl.google.com/dl/android/maven2/index.html)
问题在这里=> https://issuetracker.google.com/issues/120759347
一个临时的解决方法是将此存储库添加到您的buildscript存储库
maven { url 'https://dl.bintray.com/android/android-tools' }
答案 1 :(得分:1)
请参见this answer。 Google似乎有一些问题;他们目前正在调查中。
它在本地工作的原因是您的依存关系仍然被缓存。如果您需要 临时 进行修复,请将以下行添加到您的buildscript
-> repositories
的主(项目级别){ {1}}文件。 (请参见此other answer)
build.gradle