无法找到 com.android.tools.build:gradle:7.2.0。with Chipmunk

5
我刚刚将Android Studio更新到了Chipmunk版本,gradle文件同步不再起作用。同步出现以下错误:
Could not find com.android.tools.build:gradle:7.2.0.
Searched in the following locations:
  - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.2.0/gradle-7.2.0.pom
  - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.2.0/gradle-7.2.0.pom
Required by:
    project :
Add google Maven repository and sync project
Open File

我点击了“添加Google Maven仓库并同步项目”,但没有任何反应。我的build.gradle文件中有以下内容:
buildscript {
    ext.kotlin_version = '1.3.72'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.0'


        classpath("com.google.android.gms:oss-licenses-plugin:0.10.5")

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

有没有人能给一个关于如何修复这个问题的提示?

Android Studio Chipmunk | 2021.2.1
Build #AI-212.5712.43.2112.8512546, built on April 28, 2022
Runtime version: 11.0.12+7-b1504.28-7817840 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 16
Registry: external.system.auto.import.disabled=true, debugger.watches.in.variables=false
Non-Bundled Plugins: org.intellij.plugins.markdown (212.5457.16), com.thoughtworks.gauge (212.4746.52), org.jetbrains.kotlin (212-1.6.21-release-334-AS5457.46), com.android.aas (3.5.1), com.intellij.marketplace (212.5712.51), com.google.mad-scorecard (1.2)
3个回答

4

从stackoverflow(示例)中获取,在你的build.gradle文件中添加google():

buildscript {
repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:7.2.1'
}

}

allprojects {
repositories {
    google()
    jcenter()
}

}

[https://dev59.com/0HENtIcB2Jgan1zn83ly#71415556]


2

由于该网站上没有列出这样的版本发布,可能是一个错误。请改用7.1.3版本。

更新: 当天稍后发布了该版本。现在应该可以正常工作了。


谢谢。Android Studio 一直显示更新项目到7.2的通知。如果今天没有人提出使用7.2的方法,我将接受您的答案。 - Hong
同样的问题在这里,我把Gradle版本改回7.1.3,现在它可以工作了。 - MarioV
我查看了谷歌的Maven存储库并使用昨天的7.2.0-rc2版本。大约一个小时前出现了7.2.0版本,我确认它可用。 - Pilot_51
我的端上出现了一个奇怪的问题,就是在我将源代码从7.1.3更新到7.2.0后,所有的源代码都是相同的。当我运行时一切正常,但是当我发布APK时,在我的某个活动中,gridView无法充气卡片视图而崩溃。我尝试回滚和再次升级,确保你的APK/Bundle是完整的。 - lecandas
我在更新到7.2.0版本后遇到了奇怪的问题:无法解决配置“:app:androidApis”的所有依赖项。并且在添加新口味时无法创建任务“:app:generateDebugLintModel”。还有其他人遇到同样的问题吗? - sUndeep

2

AGP 7.2.0 刚刚发布不久,今天早些时候还没有可用的版本。请稍后再试。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接