網站首頁 編程語言 正文
首先需要知道的是:
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-10-16 python正則表達式re.group()用法_python
- 2023-02-10 C/C++?extern關鍵字用法示例全面解析_C 語言
- 2022-05-11 生產事故記錄(tomcat線程池與數據庫連接池)與(堆棧信息)Jprofile的使用
- 2023-01-26 Kotlin協程Channel源碼示例淺析_Android
- 2023-03-20 c#判斷代碼是否執行超時的幾種方式總結_C#教程
- 2022-05-05 Nginx配置ssl實現https的全過程記錄_nginx
- 2024-03-14 ThreadLocal使用,配合攔截器HandlerInterceptor使用
- 2022-09-22 Laravel解決高并發問題的思路
- 最近更新
-
- 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同步修改后的遠程分支