問題描述
我無法通過新項目從 jcenter 獲取 kotlin pom.
I'm unable to get kotlin pom from jcenter with a new project.
我所做的只是文件->新建項目并創建了一個沒有任何活動的新項目.
All I have done is gone File->New Project and created a new project with no activity.
我在嘗試構建時收到以下錯誤:
I'm getting the following error when it tries to build:
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
My 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/
If I go in my web browser to that URL I can't connect either. https://jcenter.bintray.com/
這是否意味著站點暫時關閉,或者我需要在構建文件中添加什么內容?
Does this mean the site is temporarily down or is there something I need to add to my build files?
順便說一句,我為該項目選擇了 Java,而不是設置 Kotlin,如果這很重要的話,甚至不確定它為什么要嘗試獲取 kotlin 的東西.
BTW I selected Java for the project and not Kotlin on setup if that matters so not even sure why it's trying to get kotlin stuff.
推薦答案
jcenter 當前已關閉.最后將 mavenCentral()
添加到 project build.gradle
文件中的兩組存儲庫對我來說是一種解決方法:
jcenter is currently down. In the end adding mavenCentral()
to both sets of repositories in the project build.gradle
file worked as a workaround for me:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
...
allprojects {
repositories {
mavenCentral()
google()
jcenter()
...
這篇關于無法通過新項目從 jcenter 獲取依賴項的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!