无法通过新项目从jcenter获取依赖项 [英] Unable to get dependencies from jcenter with a new project

查看:236
本文介绍了无法通过新项目从jcenter获取依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过一个新项目从jcenter获得kotlin pom.

I'm unable to get kotlin pom from jcenter with a new project.

我所要做的全部是File-> 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获取依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆