gpt4 book ai didi

android - 将Kotlin下载到Android Studio中时出现与证书相关的错误

转载 作者:行者123 更新时间:2023-12-03 04:28:08 25 4
gpt4 key购买 nike

我要完成的工作:

因此,我正在尝试将Kotlin安装到Android Studio中。我相信它已安装,但是当Gradle尝试构建项目时出现错误。这就是我的错误所在。

问题:

当Gradle尝试构建项目时,它给了我这个错误:

Error: Cause: unable to find valid certification path to requested target



这是我的build.gradle项目文件:
buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

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

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我不确定这是什么问题。

最佳答案

您需要声明google maven中央存储库。

buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
maven { url 'https://maven.google.com' } // This one
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

}
}

allprojects {
repositories {
maven { url 'https://maven.google.com' } // And this one
jcenter()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

关于android - 将Kotlin下载到Android Studio中时出现与证书相关的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44425844/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com