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

在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'

上一篇:bilibili_Linux网络基础6_DHCP服务


下一篇:bilibili_Linux网络基础7_VSFTP服务