Bitrise 错误找不到 com.google.gms:google-services:3.2.1

Bitrise error Could not find com.google.gms:google-services:3.2.1

我在 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 它在本地工作正常。

gradle 项目:

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()
    }
}

gradle 应用程序:

apply plugin: 'com.google.gms.google-services'

这里出了什么问题?

参见。 Google 似乎有一些问题;他们目前正在调查。

它在本地工作的原因是你的依赖仍然被缓存。如果您需要临时修复它,请将以下行添加到您的 buildscript --> repositories 中(项目级)build.gradle 文件。 (看这个

maven { url 'https://dl.bintray.com/android/android-tools' }

com.google.gms.google-services 刚刚从 google 存储库中消失(在 https://dl.google.com/dl/android/maven2/index.html

在这里发布 => https://issuetracker.google.com/issues/120759347

临时解决方法是将此存储库添加到您的构建脚本存储库

maven { url 'https://dl.bintray.com/android/android-tools' }