Android Studio 永远无法下载 fastutil-7.2.0.jar

标签 android android-studio android-studio-4.0

类似问题:Android studio gradle stuck at Fastutil.7.2.0.jar

当我用 Java 构建我的第一个 Android 应用程序时,Android Studio 4.0 总是报错:

Could not GET 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'. Received status code 400 from server: Bad Request
Enable Gradle 'offline mode' and sync project

但是,可以使用浏览器下载 jar

如果我在 build.gradle 中删除 jcenter(),会出现类似的错误:

Could not HEAD 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom'. Received status code 400 from server: Bad Request
Enable Gradle 'offline mode' and sync project

这个文件根本不存在。

我尝试修改 build.gradle 或设置代理,但均无效。

gradle.build 文件:

// 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:4.0.0"

        // 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
}

更新:

已解决。代理的错。检查 C:\Users\USERNAME\.gradle\gradle.properties

最佳答案

确保你已经安装了命令行工具

如果不是从安装 sdk manager > sdk tools > 检查命令行工具并应用

关于Android Studio 永远无法下载 fastutil-7.2.0.jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62241209/

相关文章:

Android 应用程序在版本中无法运行2.3

android - 如果知道关联值,我可以从 SharedPreferences 获取 key 吗?

android - 添加任何 .xml 文件时 Android Studio 2.0 中的 IDE fatal error

android - Gradle-如何在依赖项部分中使用我自己的库

android - ConstraintLayout 2.0 渲染问题

android - 将 Android Studio 更新到 4.0 后,Android View Binding 库出错

android - 无法在 flutter 中添加对android项目的依赖项

android - 未定义 layoutweight 属性时 View 消失

java - Android Studio 设置 JDK 错误

android - 从 Android Studio 运行时,为什么 Android 应用程序会在后台启动?