android - 错误:Failed to resolve: com. android.support :design:25. 4.0;错误:Failed to resolve: com. android.support :support-core-utils:25. 4.0

标签 android android-studio firebase dependencies firebaseui

我正在学习 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'    
}

还有我的 build.gradle 文件在 app 文件夹之外

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"
        }
    }
}

请问这些错误的解决方案是什么? 我一直在网上搜索这些错误的解决方案,但找不到可以解决我的问题的解决方案。

最佳答案

您需要更改这行代码:

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'

希望对您有所帮助。

关于android - 错误:Failed to resolve: com. android.support :design:25. 4.0;错误:Failed to resolve: com. android.support :support-core-utils:25. 4.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45387122/

相关文章:

javascript - TypeError : firebase. 存储不是函数

android - 无法从 https ://settings. crashlytics.com/spi/v2/platforms/android/apps/检索设置

java - Java fftpack的基本使用

Android粘性后台服务关闭后重新启动应用程序

android - 从导入的库访问项目中的 jar - gradle/android studio

android - 我应该从 android studio 中的 sdk 管理器安装哪些软件包

ios - Firebase:如何为不同的用户提供读/写访问权限?

Android:无法使用委托(delegate)证书建立 HTTPS 连接

android-studio - Android 构建错误 DexIndexOverflowException

javascript - 无法在 firebase 中构建应用程序