android - 无法获取 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom'

标签 android gradle jcenter

我尝试了我能想到的一切,但我不断收到这个错误。
这是我的 gradle 构建:

buildscript {
repositories {
    jcenter()
    maven{ url "https://dl.bintray.com/android/android-tools" }
    mavenCentral()
}
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath 'com.google.gms.google-services:4.3.3'
      // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven{url 'https://www.google.com/'}
        maven { url "https://dl.bintray.com/android/android-tools" }
    }
}


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


apply plugin: 'com.android.application'
安卓 {
compileSdkVersion 30
构建工具版本“30.0.0”
defaultConfig {
    applicationId "com.example.textbookexhange"
    minSdkVersion 16
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
}
我的 gradle 包装器很好
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip

最佳答案

无法解析 4.0 版本的原因是因为 4.0 版本在 JCenter 中不可用。
https://jcenter.bintray.com/com/android/tools/build/gradle/
首先,4.0 版应该在您的 Bintray 包中可用,以便它在 JCenter 中镜像您可以在下面的 bintray 下载链接中检查相同的内容:
https://dl.bintray.com/android/android-tools/com/android/tools/build/gradle/
更新 bintray 包中路径“com/android/tools/build/gradle”下的 4.0 版本,以便在 JCenter 中反射(reflect)出来。

关于android - 无法获取 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62857267/

相关文章:

java - 尝试用一种方法重命名录制的文件

java - 如何测试 byte[] 是否为 SHA512withRSA 签名?

android - 无法从收件箱中删除单个消息(Android 版本 4.1.2)

java - 设置JUnit 5 workingDir进行测试

android - 使用 javadocs 将库项目编译为带有 gradle 的 jar

java - 文件存在且是目录,但 listFiles() 返回 null

docker - 通过docker文件安装Gradle

android - 使用 resConfig 为 Android 风格强制语言环境

android - 在我将新版本发布到 jcenter 后,我的 Android 库不建议在 gradle 中升级新版本

缺少指向 jcenter 的 Bintray 链接