1

When running my app Android Studio is running into a build error. The Error is:

Could not GET 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.jar'. Received status code 403 from server: Forbidden

I am unsure what the cause of this is and I haven't found a solution researching on Google. It looks like it's a related to a Kotlin jar but my project uses Java only.

My other apps build fine the issue above is occurring for just one project.

If anyone has any insights as to why this is happening I'd greatly appreciate it.

Thanks

Michael J
  • 825
  • 1
  • 9
  • 18
  • 1
    Jcenter is only available over https is what I get. Maybe gradle is trying to pull over http which is causing the issue. Maybe this would help: https://stackoverflow.com/questions/36029754/force-gradle-to-use-http-instead-of-https – Mohammed Aquib Azad Jan 29 '20 at 09:39
  • And this was indeed the issue. Many, many thanks for providing the solution so quickly. – Michael J Jan 29 '20 at 09:42

2 Answers2

3

its probably too late but just replace jcenter() in root build.gradle with:

maven {
    url 'https://jcenter.bintray.com'
    name 'jcenter'
}
Masoud Aghaei
  • 775
  • 7
  • 20
3

in the project level build.gradle file add mavenCentral() to the both repositories

buildscript {
    
    ext {
        ...
    }

    repositories {
        google()
        jcenter()
        mavenCentral()
    }

    dependencies {
        ...
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}
Oveis
  • 93
  • 6