Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get dependencies from jcenter with a new project [closed]

I'm unable to get kotlin pom from jcenter with a new project.

All I have done is gone File->New Project and created a new project with no activity.

I'm getting the following error when it tries to build:

ERROR: Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'. Received status code 502 from server: Bad Gateway Enable Gradle 'offline mode' and sync project

My build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

If I go in my web browser to that URL I can't connect either. https://jcenter.bintray.com/

Does this mean the site is temporarily down or is there something I need to add to my build files?

BTW I selected Java for the project and not Kotlin on setup if that matters so not even sure why it's trying to get kotlin stuff.

like image 805
user8810083 Avatar asked Mar 21 '19 08:03

user8810083


People also ask

Is JCenter shut down?

JFrog, the company that maintains the JCenter artifact repository used by many Android projects, made JCenter a read-only repository on March 31st, 2021. According to the announcement, JCenter will allow downloads of existing artifacts indefinitely.

Is JCenter Bintray down?

JFrog, the maintainers of JCenter, announced that they are sunsetting JCenter. This means the following for Android developers for their app's dependencies: March 31st 2021 - Libraries in JCenter will no longer be updated. February 1, 2022 - JCenter will be completely shut down.

What is replacing JCenter?

Jcenter() being replaced in mavenCentral() for gradle - by May 1, 2021 - Java - Chief Delphi.

What does JCenter () do?

JCenter is a central repository on JFrog Bintray platform for finding and sharing popular JVM language packages in Maven format, used by Maven, Gradle, Ivy, SBT, and others. JCenter is the most comprehensive source for OSS Maven packages, hosting over 340,000 public packages.


2 Answers

jcenter is currently down. In the end adding mavenCentral() to both sets of repositories in the project build.gradle file worked as a workaround for me:

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()

...

allprojects {
    repositories {
        mavenCentral() 
        google() 
        jcenter()

...

like image 161
user8810083 Avatar answered Oct 22 '22 06:10

user8810083


Downgrade Gradle version is not a good fix for me. I did google around and found this. Jcenter is dead. For now.

https://status.bintray.com/?fbclid=IwAR3NLsnuGA5xqbFhcPsVLWX2c9TG40JWQcDYM7RTVsDm0qDSQvfjmhabhPg

I think all we can do is wait.

like image 5
Harvey Avatar answered Oct 22 '22 08:10

Harvey