尝试构建APK时失败

时间:2020-05-14 09:48:07

标签: android build apk classpath lint

我正在尝试构建一个APK(未签名)。每次我遇到以下错误

    FAILURE: Build failed with an exception.

    * What went wrong:
A problem occurred configuring root project 'Project Name'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.lint:lint-gradle-api:26.6.1.
     Required by:
         project : > com.android.tools.build:gradle:3.6.1
      > Could not resolve com.android.tools.lint:lint-gradle-api:26.6.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.6.1/lint-gradle-api-26.6.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.6.1/lint-gradle-api-26.6.1.pom'. Received status code 502 from server: Bad Gateway

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

我的build.gradle项目文件如下:

buildscript {
    repositories {
        jcenter()
        google()
        maven { url 'https://maven.google.com' }
        maven { url 'https://jitpack.io' }
        mavenCentral()
        maven { url "http://nexus.trifork.com/content/repositories/releases" }
        maven { url "http://dl.bintray.com/riteshakya037/maven" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
        mavenan { url 'https://jitpack.io' }
        mavenCentral()
        maven { url "http://nexus.trifork.com/content/repositories/releases" }
        maven { url "http://dl.bintray.com/riteshakya037/maven" }
    }
}

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

尝试访问错误消息中提供的链接 https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.6.1/lint-gradle-api-26.6.1.pom带领我无处...

0 个答案:

没有答案