安卓开发问题:Build was configured to prefer settings repositories over project repositories but repositor

Android开发问题记录: Build was configured to prefer settings repositories over project repositories but repositor

参考文章

遇见情况说明:导入YUtils库不成功在项目中的build.gradle添加以下内容时报错

allprojects {
    repositories {
      maven { url "https://jitpack.io" }
    }
}

项目本来只有plugins{},我加了allprojects {}后发生了这个报错
安卓开发问题:Build was configured to prefer settings repositories over project repositories but repositor_第1张图片

解决方法

  1. 将setting.gradle文件的该配置注释掉:
    安卓开发问题:Build was configured to prefer settings repositories over project repositories but repositor_第2张图片
  2. 项目的build.gradle文件中增加配置
    安卓开发问题:Build was configured to prefer settings repositories over project repositories but repositor_第3张图片
    最后,点击Sync Now即可
    安卓开发问题:Build was configured to prefer settings repositories over project repositories but repositor_第4张图片

你可能感兴趣的:(Android开发问题记录,android)