我正在学习Firebase,因为以下错误导致我们陷入困境:
Error:Failed to resolve: com.android.support:customtabs:25.4.0
Error:Failed to resolve: com.android.support.constraint:constraint-layout:1.1.0-beta1
Error:Failed to resolve: com.android.support:design:25.4.0
Error:Failed to resolve: com.android.support:support-core-utils:25.4.0
Error:Failed to resolve: com.android.support:cardview-v7:25.4.0
我的app / build.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:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
//Firebase
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.firebaseui:firebase-ui-auth:2.1.1'
testCompile 'junit:junit:4.12'
}
以及app文件夹外的build.gradle文件
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
我想问一下这些错误是什么/是解决方案? 我一直在网上搜索这些错误的解决方案,但找不到可以解决我的问题的方法。
答案 0 :(得分:1)
您需要更改以下代码行:
compile 'com.android.support.constraint:constraint-layout:1.0.2'
与
compile 'com.android.support.constraint:constraint-layout:1.0.1'
这两行有相同的版本:
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.google.firebase:firebase-auth:11.0.1'
希望它有所帮助。
答案 1 :(得分:0)
在我的程序中遇到同样的问题,我能够解决它。 根据Firebase网页上的available libraries,您应该使用最新的实时数据库相关性行: com.google.firebase:火力数据库:11.0.2