網站首頁 編程語言 正文
首先需要知道的是:
1.連接錯誤的原因是因為沒有正確上網導致的maven相關的資源拉不下來,沒有梯子,就使用國內的開源網址
2. gradle插件版本號在7.0之后,build.gradle和settings.gradle配置容易重復,導致報錯:
Build was configured to prefer settings repositories over project repositori…
解決方案
1.把settings.gradle的dependencyResolutionManagement整體注釋,settings.gradle完整代碼:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
//dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
// repositories {
// google()
mavenCentral()
// maven {
// url 'https://maven.aliyun.com/repository/central/'
// }
// }
//}
rootProject.name = "xxx"
include ':app'
include ':aidlaar'
2.在build.gradle中添加別的開源網址,完整代碼:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter() // Warning: this repository is going to shut down soon
//添加各種源
maven {
url 'https://maven.aliyun.com/repository/central/'
}
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
url "https://jitpack.io"
}
maven {
url "https://dl.bintray.com/lukaville/maven"
}
maven {
url "https://maven.google.com/"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
原文鏈接:https://blog.csdn.net/ABCDEF123236/article/details/124683545
相關推薦
- 2022-12-05 Android自定義view實現側滑欄詳解_Android
- 2022-06-22 Git配置用戶簽名方式及原因說明_其它綜合
- 2022-07-07 C++?opencv實現幾何圖形繪制_C 語言
- 2022-06-06 C#實現Excel轉PDF時設置內容適應頁面寬度_C#教程
- 2022-10-01 如何使用draw.io插件在vscode中一體化導出高質量圖片_python
- 2022-06-25 C++文件讀寫操作詳解_C 語言
- 2022-08-10 Go語言pointer及switch?fallthrough實戰詳解_Golang
- 2022-07-19 element-ui表單動態添加必填校驗
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支