这些是我的应用程序gradle文件中的依赖项。我该如何解决错误?
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
androidTestCompile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:11.4.0'
compile 'com.google.firebase:firebase-crash:11.4.0'
compile 'com.google.firebase:firebase-auth:11.4.0'
androidTestCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:3)
将此信息包含在您的根级(不是应用级别)的bulid.gradle文件中:
allprojects {
// ...
repositories {
// ...
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
有关更多说明,请查看Firebase Integration Guide.
答案 1 :(得分:2)
将maven { url "https://maven.google.com" }
添加到根级build.gradle
文件
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}