无法使用新项目从 jcenter 获取依赖项
Unable to get dependencies from jcenter with a new project
我无法通过新项目从 jcenter 获取 kotlin pom。
我所做的只是文件 -> 新建项目并创建了一个没有 activity 的新项目。
我在尝试构建时遇到以下错误:
ERROR: Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'. Received status code 502 from server: Bad Gateway Enable Gradle 'offline mode' and sync project
我的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
如果我在网络浏览器中访问那个 URL,我也无法连接。 https://jcenter.bintray.com/
这是否意味着该站点暂时关闭或者我需要向我的构建文件中添加一些内容?
顺便说一句,如果重要的话,我为项目选择了 Java 而不是设置 Kotlin,所以我什至不确定为什么要尝试获取 Kotlin 的东西。
虽然这主要是作为一个临时的、当 jcenter-正在工作时再次改回的解决方案,但可以通过将项目 [=] 中的 gradle 插件版本降级到 3.3.1 来解决这个问题13=] 文件:
classpath 'com.android.tools.build:gradle:3.3.1'
将此添加到 dependencies
块
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21"
jcenter 目前已关闭。最后,将 mavenCentral()
添加到 project build.gradle
文件中的两组存储库对我来说是一种解决方法:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
...
allprojects {
repositories {
mavenCentral()
google()
jcenter()
...
降级 Gradle 版本对我来说不是一个好的解决方法。我做了 google 并找到了这个。 Jcenter 死了。现在。
https://status.bintray.com/?fbclid=IwAR3NLsnuGA5xqbFhcPsVLWX2c9TG40JWQcDYM7RTVsDm0qDSQvfjmhabhPg
我想我们能做的就是等待。
jfrog bintray (https://status.bintray.com/incidents/2wvx6d5f807c) 中 Downloads
部分 Partial Outage
有问题:
Intermittent download issues in Bintray
您可以在https://status.bintray.com/
中查看当前状态
从 jfrog Bintray 更新状态:
Update - There are still intermittent download issues in Oregon region (north America). We are still working on identifying the root cause.
Mar 21, 10:02 UTC
用 mavenCentral() 替换 jcenter()
因为 jcenter 现在不可用
实际上 android studio 已经为您提供了解决方案:
仅同步活动变体
您可以禁用此实验性功能
文件 → 设置 → 实验 → Gradle → 仅同步活动变体
要修复它,请打开 android sdk 管理器并:
1.Uninstall android 支持存储库
2.Install 再次 android 支持存储库
3.clean 项目并重建它
3 天后,我仍然从 bintray 收到随机 502 错误,链接似乎完全有效。使用浏览器/curl 手动检查 pom 文件是否存在。
最终帮助绕过的是通过不让它同时点击所有链接来减慢 gradle 的速度。在我的例子中,cordova/ionic 项目,所以
ionic cordova run android -- -- --gradleArg=--max-workers=1
传递 --no-parallel
应该也有效
我无法通过新项目从 jcenter 获取 kotlin pom。
我所做的只是文件 -> 新建项目并创建了一个没有 activity 的新项目。
我在尝试构建时遇到以下错误:
ERROR: Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'. Received status code 502 from server: Bad Gateway Enable Gradle 'offline mode' and sync project
我的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
如果我在网络浏览器中访问那个 URL,我也无法连接。 https://jcenter.bintray.com/
这是否意味着该站点暂时关闭或者我需要向我的构建文件中添加一些内容?
顺便说一句,如果重要的话,我为项目选择了 Java 而不是设置 Kotlin,所以我什至不确定为什么要尝试获取 Kotlin 的东西。
虽然这主要是作为一个临时的、当 jcenter-正在工作时再次改回的解决方案,但可以通过将项目 [=] 中的 gradle 插件版本降级到 3.3.1 来解决这个问题13=] 文件:
classpath 'com.android.tools.build:gradle:3.3.1'
将此添加到 dependencies
块
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21"
jcenter 目前已关闭。最后,将 mavenCentral()
添加到 project build.gradle
文件中的两组存储库对我来说是一种解决方法:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
...
allprojects {
repositories {
mavenCentral()
google()
jcenter()
...
降级 Gradle 版本对我来说不是一个好的解决方法。我做了 google 并找到了这个。 Jcenter 死了。现在。
https://status.bintray.com/?fbclid=IwAR3NLsnuGA5xqbFhcPsVLWX2c9TG40JWQcDYM7RTVsDm0qDSQvfjmhabhPg
我想我们能做的就是等待。
jfrog bintray (https://status.bintray.com/incidents/2wvx6d5f807c) 中 Downloads
部分 Partial Outage
有问题:
Intermittent download issues in Bintray
您可以在https://status.bintray.com/
中查看当前状态从 jfrog Bintray 更新状态:
Update - There are still intermittent download issues in Oregon region (north America). We are still working on identifying the root cause.
Mar 21, 10:02 UTC
用 mavenCentral() 替换 jcenter() 因为 jcenter 现在不可用
实际上 android studio 已经为您提供了解决方案:
仅同步活动变体 您可以禁用此实验性功能 文件 → 设置 → 实验 → Gradle → 仅同步活动变体
要修复它,请打开 android sdk 管理器并:
1.Uninstall android 支持存储库 2.Install 再次 android 支持存储库 3.clean 项目并重建它
3 天后,我仍然从 bintray 收到随机 502 错误,链接似乎完全有效。使用浏览器/curl 手动检查 pom 文件是否存在。
最终帮助绕过的是通过不让它同时点击所有链接来减慢 gradle 的速度。在我的例子中,cordova/ionic 项目,所以
ionic cordova run android -- -- --gradleArg=--max-workers=1
传递 --no-parallel
应该也有效