android-studio - 我无法将我的项目同步到 gradle,出现此错误“添加 google Maven 存储库并同步项目”
问题描述
我尝试在我的存储库中添加这些代码:
google()
jcenter()
maven {
url 'https://maven.google.com'
}
但即使是现在我也无法同步 gradle
解决方案
在项目的build.gradle中,修改如下:
buildscript {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} // <-- add
//jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
allprojects {
repositories {
google()
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} // <-- add
//jcenter()
}
}
我希望这有帮助
推荐阅读
- html - css 如何使内联块浮动到顶部?
- python - Python中的IndexError,同时基于模式拆分输入文件
- python - Kiwi-tcms Django 插件安装问题
- mysql - 多边形的众所周知的二进制(WKB)格式?
- java - OneToOne 和 OneToMany 关系实体未在 Spring Boot 单元测试中加载
- wpf - 如何在 WPF 中设置 DataGridRow 颜色和交替行颜色?
- python - 找到最接近其他 DataFrame 的行并获取该行的索引
- python-3.6 - 如果列表 A 中的每个成员都(或不)在列表 B 中,如何搜索并返回 1(或 0)
- flutter - 颤振缺少公共目录
- ruby-on-rails - ActiveStorage::InvariableError 使用 Mini Magick