完整的异常:InvalidUserCodeException
Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle'
解决:
1.删除项目build.gradle(Project)下的如下代码
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://jitpack.io' }
}
}
2.在项目settings.gradle文件下添加仓库路径
dependencyResolutionManagement {
...
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven {
url 'https://jitpack.io' }
}
}