【问题标题】:Synchronizing Gradle failed due to unknown issues with downloads由于下载存在未知问题,同步 Gradle 失败
【发布时间】:2018-03-27 13:49:57
【问题描述】:

我整天都在尝试修复这个错误。我早上所做的就是更新我在 Android Studio 上的编译器。就在那时,一切都变得非常糟糕。从那以后我卸载了编译器...

这些是我每次尝试同步 gradle 时都会遇到的错误类型:

Gradle sync failed: Could not find org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0.
Searched in the following locations:
         https://maven.google.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.pom
         https://maven.google.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.jar

是最新的,也是我无法解决的……我尝试过的事情:

  • 为了解决其他问题,我物理下载了 jar 文件并 将它们放在各自的位置(在 kotlin 1.2.0 中失败)...
  • 我也将此添加到我的 gradle 中:

.

buildscript {
repositories {
    jcenter()
    google()
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://jitpack.io' }
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'
    classpath 'io.fabric.tools:gradle:1.+'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

这解决了我的其他问题...

  • 我尝试从离线模式运行,但失败了...
  • 我尝试将文件下载到项目中并像这样引用它:

.

compile files('kotlin-stdlib-jre8-1.2.0.jar')

我早就删除了编译器,只是坚持要做什么......我在网上找不到任何方法来解决我的问题

【问题讨论】:

  • 请记住 kotlin-stdlib-jre8kotlin-stdlib-jdk8 是 minSdk 24。

标签: android kotlin android-gradle-plugin synchronization


【解决方案1】:

我在更新到新的 Android Studio 后也遇到了这个问题。您需要显式地提供具有新 Kotlin 版本的依赖项。在您的应用级 build.gradle 文件中添加:

compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.30"

您可能还需要添加其他依赖项:

compile "org.jetbrains.kotlin:kotlin-stdlib:1.2.30"
compile "org.jetbrains.kotlin:kotlin-reflect:1.2.30"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.30"

【讨论】:

  • 伙计,我也遇到了这个问题...我刚刚删除了所有内容,并在重新安装后从我的仓库中提取了
  • 它没有用...我将尝试做@ThabisoMotswagole 所做的事情,看看是否有效
猜你喜欢
  • 1970-01-01
  • 2020-09-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多