android - 无法获取“https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom”
问题描述
我尝试了我能想到的一切,但我不断收到这个错误。这是我的 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'
android { compileSdkVersion 30 buildToolsVersion "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/安卓/工具/构建/gradle/
更新 bintray 包中路径“com/android/tools/build/gradle”下的 4.0 版本,以便在 JCenter 中反映出来。
推荐阅读
- swift - 在 SWIFT 中分解字符串
- apache-spark - 结构化流 CoarseGrainedExecutorBackend:驱动程序命令关闭
- kubernetes - DNS 查找在 Kubernetes 集群中无法正常工作
- jsonschema - JSON模式递归似乎没有正确验证
- google-ads-api - Google 广告脚本,AdsApp.adGroups().get() 返回空
- python-3.x - 具有扩展窗口功能的熊猫多索引
- java - jar 不能通过双击在 Mac 上运行
- google-cloud-platform - 如何将一个 bigquery 数据集复制或传输到来自不同 gcp 组织的另一个 bigquery
- php - 带有 Volley Kotlin 的 RESTful API 不起作用
- spring-data-jpa - 如何使用 CriteriaApi 或 JPA 通过“WHERE”之后的表达式部分进行选择