适配firebase-auth 12.0.0的firebase-ui-auth版本查询及版本冲突问题
适配Firebase Auth 12.0.0的Firebase UI Auth版本及版本冲突解决
针对你的问题,适配firebase-auth:12.0.0的正确firebase-ui-auth版本是4.0.0——这个版本正是为Firebase SDK 12.0.0系列打造的,能完美解决你遇到的版本兼容问题。
为什么之前的尝试会出问题?
- 你试的
firebase-ui-auth:3.2.2属于3.x系列,它仅兼容Firebase SDK 11.x版本(比如firebase-auth:11.8.0),和firebase-auth:12.0.0混用必然触发兼容性报错。 - 版本混合问题的核心根源是:所有
com.google.android.gms(比如play-services-location)和com.google.firebase系列的库,必须保持完全一致的版本号,不能一部分用11.8.0、一部分用12.0.0,否则会出现依赖冲突。
正确的依赖配置示例
在你的模块级build.gradle中,统一所有相关库的版本:
// Firebase Auth 核心库 implementation 'com.google.firebase:firebase-auth:12.0.0' // 适配的Firebase UI Auth版本 implementation 'com.firebaseui:firebase-ui-auth:4.0.0' // Play Services Location 保持同版本 implementation 'com.google.android.gms:play-services-location:12.0.0'
同时,确保项目根目录的build.gradle中,Google服务插件的版本支持12.0.0系列SDK,比如:
buildscript { dependencies { classpath 'com.google.gms:google-services:4.0.1' } }
额外说明
当时GitHub页面只显示到11.8.0,是因为Firebase UI Auth 4.0.0是和Firebase SDK 12.0.0同步发布的,你直接在依赖中指定4.0.0版本即可,Gradle会自动拉取对应的资源。
内容的提问来源于stack exchange,提问作者user6126396
相关产品推荐
相关产品推荐

