gpt4 book ai didi

android - 在 build.gradle(project) 中添加存储库的问题

转载 作者:行者123 更新时间:2023-12-04 23:41:38 24 4
gpt4 key购买 nike

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.0"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我得到的错误
评估根项目“LuckyMuch”时出现问题。

Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle'


  • 尝试:
    使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
  • 最佳答案

    即使我遇到了这个问题,我也用下面的代码更新了 settings.gradle 文件,它对我有用

    dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_PROJECT)
    repositories {
    google()
    mavenCentral()
    }
    }
    rootProject.name = "Chat App"
    include ':app'

    关于android - 在 build.gradle(project) 中添加存储库的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68747059/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com