1

After updating com.android.tools.build:gradle and com.google.gms:google-services I can build project local (command gradlew build --scan) but in Bitrise I get BUILD FAILED and message:

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'git'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:4.1.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:4.1.0.
> Could not get resource 
'http://dl.bintray.com/populov/maven/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
> Could not GET 
'http://dl.bintray.com/populov/maven/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'. 
Received status code 502 from server: Bad Gateway
> Could not resolve com.google.gms:google-services:4.2.0.
Required by:
project :
> Could not resolve com.google.gms:google-services:4.2.0.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/gms/google- 
services/4.2.0/google-services-4.2.0.pom'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/gms/google- 
services/4.2.0/google-services-4.2.0.pom'. Received status code 502 from server: Bad Gateway
> Could not resolve io.fabric.tools:gradle:1.28.0.

I've tried every recommendations what I found, but I still get this message.

My build.gradle file

buildscript {
repositories {
    maven { url "http://dl.bintray.com/populov/maven" }
    google()
    mavenCentral()
    jcenter()
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
    maven { url 'https://dl.bintray.com/android/android-tools' }
    maven { url 'https://maven.fabric.io/public' }
    maven {
        url 'https://google.bintray.com/exoplayer/'
    }
}

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.0'
    classpath 'com.google.gms:google-services:4.2.0'
    classpath 'io.fabric.tools:gradle:1.28.0'
    classpath "me.tatarka:gradle-retrolambda:3.7.1'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}
allprojects {
repositories {
    maven { url "http://dl.bintray.com/populov/maven" }
    mavenCentral()
    jcenter()
    maven {
        url "https://maven.google.com/"
        name 'Google'
    }
    maven { url "https://dl.bintray.com/android/android-tools" }
    maven { url "https://maven.fabric.io/public" }
    maven {
        url "https://google.bintray.com/exoplayer/"
    }
}
}

gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Monica
  • 384
  • 2
  • 4
  • 16

1 Answers1

6

Seems like jcenter is currently down. (see https://jcenter.bintray.com/)

You can wait for jcenter to be up or migrate to use something else: https://developer.android.com/studio/build/jcenter-migration

Gkueny
  • 136
  • 4
  • yes, I have read about it. But in project uses some library , that are not in maven central. Also I have read, that I can use old libraries from jcenter() – Monica May 04 '22 at 20:33
  • 1
    yeah, i'm also in this situation :( . jcenter will normally be available for life, but you should expect to have this kind of problem since the project is abandoned. Just have to cross our fingers that it will be up again soon. – Gkueny May 04 '22 at 21:02
  • 1
    replacing all references from `jcenter()` with `mavenCentral()` in gradle scripts might resolve the issue for you. It seems that the most packages are also published to mavens official repo. – cpc May 05 '22 at 06:57
  • Yep, in my case I also had to: either update some libraries or retrieve the `.jar` (from my computer's cache) of the libraries I could not update and only available on jcenter – Gkueny May 06 '22 at 13:32
  • Seems to be down a while now. Any update or ideas? – kierandes May 16 '22 at 17:05
  • 1
    @kierandes, I think we can assume that despite their announcement (https://jfrog.com/fr/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/), jcenter is no longer reliable and that it is time to migrate. There is no magic solution, but you can try: - replace the occurrences of `jcenter()` by `MavenCentral()` (some libs have migrated to maven central) - update dependencies (some libs have migrated only the lastest versions to maven central) - replace dependencies (some libs have not migrated) Good luck – Gkueny May 17 '22 at 07:14
  • Thanks @Gkueny, that's a pity. I'll try what you suggest. – kierandes May 18 '22 at 08:31