【问题标题】:Gradle com.android.support and com.google.android.gms library conflictGradle com.android.support 和 com.google.android.gms 库冲突
【发布时间】:2017-06-05 13:04:55
【问题描述】:

我正在我的主项目中开发一个 Firebase 聊天应用程序,并将 Firebase 依赖项添加到我的 build.gradle,但是在同步后我收到了这条消息:

所有 com.android.support 库必须使用完全相同的版本规范(混合版本会导致运行时崩溃。)找到版本 25.3.1、25.0.0、23.4.0。示例包括 com.android.support:animated-vector-drawable:25.3.1 和 com.android.support:palette-v7:25.0.0

compile 'com.android.support:appcompat-v7:25.3.1'

所有 com.google.android.gms 库必须使用完全相同的版本规范(混合版本会导致运行时崩溃。)找到版本 9.8.0、10.2.6。示例包括 com.google.android.gms:play-services-auth-base:9.8.0 和 com.google.android.gms:play-services-ads-lite:10.2.6

compile 'com.google.android.gms:play-services-ads:10.2.6'

这是我在 build.gradle (Module:app) 中的依赖项:

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 files('lib/mysql-connector-java-5.1.6.jar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-ads:10.2.6'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'


//Chat dependencies
compile 'com.android.support:design:25.3.1'
compile 'com.firebaseui:firebase-ui:0.6.2'
compile 'com.github.hani-momanii:SuperNova-Emoji:1.0'
}

【问题讨论】:

    标签: android gradle


    【解决方案1】:

    根据您的 build.gradle 文件, 发现重复的代码行

    compile 'com.android.support:design:25.3.1'
    

    删除一个并尝试。

    【讨论】:

      猜你喜欢
      • 2021-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多