当前位置: 首页 > 工具软件 > build > 使用案例 >

but repository ‘maven‘ was added by build file ‘build.gradle‘

骆鸿运
2023-12-01

在build.gradle中添加maven { url 'https://jitpack.io' }报错: but repository 'maven' was added by build file 'build.gradle'。。。

处理方法是不要添加在build.gradle里面,而是settings.gradle:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
rootProject.name = "TestApp"
include ':app'

 类似资料:

相关阅读

相关文章

相关问答