适配google services 3.1.0的Firebase UI版本冲突问题咨询
Hey there, let's tackle this Firebase UI compatibility issue you're facing with Google Services 3.1.0. I’ve dealt with similar version mismatch headaches before, so here’s a step-by-step breakdown of fixes that should get things working smoothly:
1. Lock Firebase UI to a Compatible Version
Google Services 3.1.0 pairs best with Firebase UI 3.1.3 — it’s the last stable release that fully aligns with this Google Services version and avoids forcing newer support libraries that cause conflicts.
Update your app-level build.gradle dependencies to use this version across all Firebase UI modules you need:
implementation 'com.firebaseui:firebase-ui-auth:3.1.3' // Match the version for other Firebase UI modules if you use them implementation 'com.firebaseui:firebase-ui-database:3.1.3' implementation 'com.firebaseui:firebase-ui-storage:3.1.3'
2. Force Consistent Support Library Versions
Mixed support library versions pulled in by Firebase UI and other dependencies are the #1 cause of these errors. Add a resolution strategy to your app-level build.gradle to lock all support libraries to a version compatible with Google Services 3.1.0 — 27.1.1 is the sweet spot here:
configurations.all { resolutionStrategy { force 'com.android.support:appcompat-v7:27.1.1' force 'com.android.support:support-v4:27.1.1' force 'com.android.support:design:27.1.1' // Add any other support libraries your project uses here } }
3. Verify Google Services Plugin Placement
Make sure the Google Services plugin is applied after all your dependencies in the app-level build.gradle. This ensures the plugin correctly resolves Firebase dependencies without unexpected conflicts:
dependencies { // All your project dependencies go here first } apply plugin: 'com.google.gms.google-services'
4. Clean & Rebuild Your Project
Old build artifacts often hang around and cause lingering issues even after you fix dependencies. Run these steps in Android Studio:
- Navigate to
Build > Clean Project - Follow up with
Build > Rebuild Project - Or use the terminal commands:
./gradlew clean ./gradlew assembleDebug
5. Align Firebase Core Version
Firebase UI relies on Firebase Core, so make sure it’s compatible with both Google Services 3.1.0 and Firebase UI 3.1.3. Use Firebase Core 11.8.0 in your dependencies:
implementation 'com.google.firebase:firebase-core:11.8.0'
If you’re still running into problems, double-check your gradle-wrapper.properties to ensure you’re using Gradle 4.6 or newer — this version supports the dependency versions we’ve outlined here.
内容的提问来源于stack exchange,提问作者Eli Kozinets

