使用最新版本android studio 报错如下
configured to prefer settings repositories over project repositories but repository
我的版本是Android Studio Arctic Fox | 2020.3.1 Patch 1
百度谷歌一番发现
https://blog.csdn.net/m0_60322358/article/details/119521995
说是删除 setting.gradle中的 dependencyResolutionManagement{}一整段代码
但是又遇到新问题,就是各种依赖找不到,类似这种
Could not find com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4.
Could not find com.tencent:mmkv-static:1.2.4.
Could not find com.google.code.gson:gson:2.8.5.
也就是说找不到各种依赖,那就要给出依赖库的位置
解决方案
在project-level也就是工程目录下的build.gradle中添加库路径就可以
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}