错误信息:
在引入依赖时报错:Failed to resolve: xxx.xxxx:1.1.0
解决方案:
需要修改maven库的代理,否则就需要翻墙编译
新的AndroidStudio版本比较坑,修改代理的位置发生了变化:
最新变化:
修改settings.gradle文件(注意:不是以前的build.gradle)
bash
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
maven { allowInsecureProtocol = true
url "https://jitpack.io" }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
maven { allowInsecureProtocol = true
url "https://jitpack.io" }
}
}
rootProject.name = "xxxxx"
include ':app'
重新编译即可
更多相关问题解决:
如果您感觉文章有用的话,麻烦点个赞吧!
如果您发现文章有任何错误或建议,请评论区留言或者私信!
深海谢过各位的支持,一起加油!