You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

更新依赖库后出现重复Zip条目及Dex合并失败问题求助

Fixing FirebaseUI & Firebase/Play Services Version Mismatch

Got it, you’re right to pair Firebase/Play Services 15.0.0 with FirebaseUI 3.3.1— that’s the correct match per the docs. The problem here is almost certainly transitive dependencies pulling in conflicting versions of shared libraries (like Firebase components or Android Support libraries) that override your explicit implementation declarations.

Here’s how to resolve this step by step:

1. Identify Conflicting Dependencies

First, let’s pinpoint exactly which libraries are causing the mismatch. Run this command from your project’s root directory to generate a full dependency tree:

./gradlew app:dependencies

Look for entries under com.google.firebase, com.google.android.gms, or com.android.support that have versions different from 15.0.0 (for Firebase/Play Services) or 27.1.1 (the Support Library version FirebaseUI 3.3.1 relies on).

2. Force Correct Versions

Add a configurations block to your app-level build.gradle file. This tells Gradle to override any transitive dependency versions with the ones you specify:

configurations.all {
    resolutionStrategy {
        // Force Firebase/Play Services to 15.0.0
        force 'com.google.firebase:firebase-core:15.0.0'
        force 'com.google.android.gms:play-services-auth:15.0.0'
        // Add any other Firebase/Play Services modules you're using here
        
        // Force Support Library versions compatible with FirebaseUI 3.3.1
        force 'com.android.support:appcompat-v7:27.1.1'
        force 'com.android.support:design:27.1.1'
        force 'com.android.support:cardview-v7:27.1.1'
    }
}

3. Update Your Dependencies Block

Make sure your dependencies explicitly include FirebaseUI and the Firebase components you need, with their correct versions. Here’s how your updated block might look:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    
    // FirebaseUI modules (add only what you use)
    implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
    implementation 'com.firebaseui:firebase-ui-database:3.3.1'
    
    // Matching Firebase/Play Services
    implementation 'com.google.firebase:firebase-core:15.0.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.0'
    
    // Keep your existing test dependencies
    androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
}

4. Sync & Clean Build

After making these changes:

  • Sync your project with Gradle files (click the "Sync Now" prompt in Android Studio)
  • Run a clean build to ensure all dependencies are properly resolved:
./gradlew clean build

This should eliminate the transitive dependency conflicts by forcing all libraries to use versions compatible with your FirebaseUI and Firebase/Play Services setup.

内容的提问来源于stack exchange,提问作者Rohit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:35:17