android - Gradle 同步失败:在存储库容器上找不到参数 [] 的方法 google()
问题描述
这是该项目反复出现的问题。我尝试了几种不同的解决方案,但都没有奏效。包括更新 gradle-wrapper.properties 中的类路径版本和版本号。
Build.Gradle 文件:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0-alpha09'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle-Wrapper.properties 文件:
#Thu Jan 30 12:09:16 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-rc-1-all.zip
解决方案
推荐阅读
- javascript - 将输入字段的宽度调整为模态
- c# - 以下 VB.NET 代码的 C# 等效项是什么?
- javascript - 如何在三元语句中添加第三个条件?
- node.js - 对于多个条件,postgres UPDATE 的正确语法?
- python - Python 绑定套接字:“地址已在使用中”,关闭套接字后
- spring-mvc - Spring MockMvc 不要期望内容
- php - 以计算机可读格式获取 MySQL 权限
- javascript - 将 FormData 传递给 AJAX 调用时如何修复 HttpPostedFileBase null
- ember.js - Ember 开发服务器似乎在测试模式下运行
- r - 如何通过排除 r 中第 1 组中的前 300 个测量值来计算平均值