Search code examples
androidgradlecontinuous-integrationbitrise

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


I get the following error in bitrise CI, although the build works find locally. I made no changes to the gradle files yet they suddenly stopper working in 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 :

but ./gradlew assembleDebug it works fine locally.

gradle project:

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 app:

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

What's going wrong here?


Solution

  • com.google.gms.google-services just disappears from google repository (at https://dl.google.com/dl/android/maven2/index.html)

    Issue here => https://issuetracker.google.com/issues/120759347

    A temporary workaround is to add this repository to your buildscript repositories

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