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

倖福魔咒の 提交于 2019-11-27 08:36:44
user8810083

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

...

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.

Chisko

While mostly meant as a temporary, change-back-again-when-jcenter-is-working solution, this can be fixed by downgrading the gradle plugin version to 3.3.1 in the project's gradle file:

classpath 'com.android.tools.build:gradle:3.3.1'

There is a problem in Downloads section with Partial Outage in jfrog bintray (https://status.bintray.com/incidents/2wvx6d5f807c):

Intermittent download issues in Bintray

You can see the current status in https://status.bintray.com/


Update Status from jfrog Bintray:

Update - There are still intermittent download issues in Oregon region (north America). We are still working on identifying the root cause. 
Mar 21, 10:02 UTC

Add this to dependencies block

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21"

replace jcenter() with mavenCentral() because jcenter is not available now

Actually android studio already had the solution for you :

Syncing only active variant You can disable this experimental feature from File → Settings → Experimental → Gradle → Only sync the active variant

I have same issue, and I tried aliyun maven in this issue's answer,

jcenter 502 bad gateway after gradle refresh

and it works. So I temporary use this for building app.

To fix it open android sdk manager and:

1.Uninstall android support repository 2.Install again android support repository 3.clean project and rebuild it

It's 3 days later and i was still getting random 502 errors from bintray, for links that seemed perfectly valid. Manually checking with browser / curl the pom files were there.

What eventually helped get around, was slowing gradle down by not letting it hit the links all at once. In my case, cordova/ionic project, so

ionic cordova run android -- -- --gradleArg=--max-workers=1

Passing --no-parallel should work as well

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!