gpt4 book ai didi

java - 找不到 Android Studio 构建 Gradle

转载 作者:行者123 更新时间:2023-11-29 18:26:20 25 4
gpt4 key购买 nike

我有一个 Android Studio 项目,这是 build.gradle 文件:

buildscript {
ext.kotlin_version = "1.1.3"
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}

当我尝试构建应用程序时出现此错误:

Gradle sync failed: Could not find gradle.jar (com.android.tools.build:gradle:3.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Consult IDE log for more details (Help | Show Log) (899 ms)

知道问题出在哪里吗?

最佳答案

Gradle sync failed: Could not find gradle.jar (com.android.tools.build:gradle:3.0.0).

您应该升级 tools.build:gradle 版本。

 classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
classpath 'com.google.gms:google-services:4.3.2'

gradle-wrapper

distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip //5.4.1

之后,Clean->Rebuild->Gradle

关于java - 找不到 Android Studio 构建 Gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58798184/

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