如何解决Firebase Admin SDK与firebase-core依赖不兼容问题?
Hey there! Let's sort out this version mismatch issue between your Firebase client and admin SDKs.
First, a quick key point: Firebase's client SDKs (like firebase-core for Android) and Admin SDKs have separate versioning systems, so they don't need an exact number match—but they do need to be aligned in terms of feature support to work smoothly together. Your current firebase-core:11.8.0 is a pretty old client release (circa late 2017), so we need to pick an Admin SDK version that's compatible with the feature set of that client era.
Recommended Version Combinations
- Sticking with your existing client SDK: If you don't want to upgrade
firebase-core:11.8.0, go withcom.google.firebase:firebase-admin:5.12.0or5.13.0. These Admin SDK versions were released around the same time as the 11.x client SDKs, so they fully support all the features your client is using and won't throw compatibility errors. - Better long-term option: Upgrade both (for security & features): Old SDK versions lack critical security patches and new features. If you can upgrade your client SDK, here's a stable, compatible pair:
- Client:
com.google.firebase:firebase-core:19.0.0(the last standalonefirebase-corerelease—after this, Firebase Core functionality is bundled into the Firebase BOM) - Admin:
com.google.firebase:firebase-admin:9.0.0
- Client:
Pro Tip for Future Compatibility
Once you're ready for a more streamlined setup, use the Firebase BOM (Bill of Materials) for your client SDKs. The BOM automatically manages all client SDK versions to ensure they're compatible, so you never have to manually match individual SDK versions again. Here's how it looks in Gradle:
implementation platform('com.google.firebase:firebase-bom:32.7.0') implementation 'com.google.firebase:firebase-core'
For this BOM version, you can safely use com.google.firebase:firebase-admin:12.0.0 as your Admin SDK—it's fully compatible with all features in the BOM-managed client SDKs.
内容的提问来源于stack exchange,提问作者Octavian Catusanu

