将Gradle从1.5升级到2..0以上的时候,有时编译会报这个错:Authentication scheme ‘all’(Authentication) is not supported by protocol ‘file’
一种解决方法是:将原项目的build.gradle文件中的这段:
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url getMavenRepoUrl()
credentials {
username getMavenUsername()
password getMavenApiKey()
}
}
flatDir {
dirs 'libs'
}
}
}
改成:
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
flatDir {
dirs 'libs'
}
}
}
对比修改其中不同的地方即可,在我的项目里测试通过,希望对大家有用。