原创

Android Studio 编译报错:ERROR:Could not GET 'XXX'. Received status code 403 from server: Forbidden Enable Gradle 'offline mode' and sync project

错误

ERROR: Could not GET 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'. Received status code 403 from server: Forbidden
Enable Gradle 'offline mode' and sync project。

file

解决

将build.gradle中的http://jcenter.bintray.com 改成https://jcenter.bintray.com。

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

buildscript {

    repositories {
        google()
        jcenter(){url 'https://jcenter.bintray.com/'}
    }
    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(){url 'https://jcenter.bintray.com/'}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
正文到此结束
本文目录