我第一次安装 Android Studio(2021.3.1.17)并继续导入我的 Eclipse/ADT 项目。
项目本身的导入似乎进展顺利,但我收到以下错误:
Could not find com.android.tools.build:gradle:7.3.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/7.3.1/gradle-7.3.1.pom
我添加到项目的build.gradle
下列:
maven {
url "https://maven.google.com"
}
现在它有:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}
但我仍然收到此错误。
我缺少什么?我怎样才能解决这个问题?
通过将 Maven 子句从allprojects
to buildscript
这样整个 build.gradle 现在是:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
}
}
allprojects {
repositories {
jcenter()
}
}
另请注意,compile
该配置自 Gradle 4.10(2018 年 8 月 27 日)起已弃用,并最终在 Gradle 7.0(2021 年 4 月 9 日)中删除,取而代之 https://stackoverflow.com/questions/23796404/could-not-find-method-compile-for-arguments-gradle#comment131940678_66910991 implementation
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)