gpt4 book ai didi

android - 错误 : Could not find com. android.tools.build :gradle:3. 4.1

转载 作者:行者123 更新时间:2023-12-03 02:53:22 32 4
gpt4 key购买 nike

我正在尝试更新我的 Android 项目。

我最初得到这个错误:

ERROR: Gradle DSL method not found: 'classpath()' Possible causes: The project 'xxx' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Upgrade plugin to version 3.4.1 and sync project

所以我在我的应用程序的 build.gradle 中尝试了这个:

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'io.fabric.tools:gradle:1.29.0'
}
}

但现在我收到了这个错误:

ERROR: Could not find com.android.tools.build:gradle:3.4.1.

要做什么?感谢您的帮助。

最佳答案

目前版本的 Android Gradle 插件似乎没有添加到 Maven Central 中,但它们存在于 jcenter 中。将 jcenter() 添加到您的存储库列表中,Gradle 应该会找到版本

repositories {
....
jcenter()
...
}

关于android - 错误 : Could not find com. android.tools.build :gradle:3. 4.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56201386/

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