Home > Developer Guide > Guides > Firebase KTX Deprecation


Firebase KTX Module Deprecation (BOM 34.x+)

Critical Notice: Firebase stopped releasing KTX modules in July 2025 and removed them from BOM 34.0.0+

Impact: Existing code using -ktx dependencies must either stay on BOM 33.x or migrate to non-KTX modules

Discovered: During PR #269 debugging session (2025-11-18) after 6 failed build attempts

Overview

What Happened

In July 2025, Firebase made a breaking change to their Bill of Materials (BOM) structure:

Firebase BOM 33.x (Last KTX Version):

  • Includes all -ktx library variants
  • Example: firebase-auth-ktx, firebase-firestore-ktx, firebase-analytics-ktx
  • KTX APIs provide Kotlin extensions and coroutine support

Firebase BOM 34.0.0+ (KTX Removed):

  • Removed all -ktx library variants from BOM
  • KTX APIs merged into main modules
  • Example: Use firebase-auth instead of firebase-auth-ktx
  • Same Kotlin APIs, different artifact names

Why This Matters

Build Failure Symptom:

Could not find com.google.firebase:firebase-analytics-ktx:.
                                                            ^
                                                            Empty version string

Root Cause:

  • Your build.gradle.kts references firebase-analytics-ktx
  • Your BOM is version 34.0.0 or higher
  • BOM 34.x doesn’t include -ktx libraries
  • Gradle can’t find version information → empty string

Impact on Version Catalogs: If using Gradle version catalogs without versions for BOM-managed dependencies, builds will fail silently with empty version strings.


Timeline & Context

Firebase’s Decision

Announcement: July 2025 (Firebase Release Notes)

Rationale:

  • Kotlin extensions matured and stabilized
  • No longer needed separate KTX artifacts
  • Reduced maintenance burden
  • Simplified dependency management

Migration Path:

“All KTX APIs are now available in the main modules. Simply drop the -ktx suffix from your dependencies.”

Discovery in Archery Apprentice Project

Date: 2025-11-18 (Week 28) Context: PR #269 - Gradle dependency updates Debugging Duration: ~2 hours, 6 build attempts

Initial Symptom:

implementation(platform(libs.firebase.bom))  // BOM 34.6.0
implementation(libs.firebase.analytics.ktx)   // Not in BOM!

Error:

Could not find com.google.firebase:firebase-analytics-ktx:.
Could not find com.google.firebase:firebase-crashlytics-ktx:.

Red Herrings Investigated:

  1. Version catalog syntax issues (syntax was correct)
  2. Gradle cache corruption (cleared multiple times)
  3. KSP version incompatibility (unrelated)
  4. Network/Maven repository issues (not the cause)

Breakthrough: Compared working main branch:

  • Main uses BOM 33.0.0 with hardcoded dependencies
  • PR branch attempted BOM 34.6.0 with version catalog
  • Discovered Firebase removed KTX from BOM 34.0.0

Related Documentation:


BOM Version Comparison

Firebase BOM 33.x (KTX Supported)

Includes:

com.google.firebase:firebase-auth-ktx:22.1.0
com.google.firebase:firebase-firestore-ktx:24.7.0
com.google.firebase:firebase-analytics-ktx:21.3.0
com.google.firebase:firebase-crashlytics-ktx:18.4.1

Usage:

dependencies {
    implementation(platform("com.google.firebase:firebase-bom:33.0.0"))
    implementation("com.google.firebase:firebase-auth-ktx")
    implementation("com.google.firebase:firebase-firestore-ktx")
    implementation("com.google.firebase:firebase-analytics-ktx")
}

Status: ✅ Stable, supported, recommended for existing projects


Firebase BOM 34.x+ (KTX Removed)

Does NOT Include:

com.google.firebase:firebase-auth-ktx         ❌ Not in BOM
com.google.firebase:firebase-firestore-ktx    ❌ Not in BOM
com.google.firebase:firebase-analytics-ktx    ❌ Not in BOM

Includes Instead:

com.google.firebase:firebase-auth:22.1.2       ✅ Main module
com.google.firebase:firebase-firestore:24.8.0  ✅ Main module
com.google.firebase:firebase-analytics:21.4.0  ✅ Main module

Correct Usage:

dependencies {
    implementation(platform("com.google.firebase:firebase-bom:34.6.0"))
    implementation("com.google.firebase:firebase-auth")        // No -ktx!
    implementation("com.google.firebase:firebase-firestore")   // No -ktx!
    implementation("com.google.firebase:firebase-analytics")   // No -ktx!
}

Status: ✅ Current, recommended for new projects


Migration Strategies

When to Use:

  • Large existing codebase with -ktx dependencies
  • Not ready for immediate migration
  • Need stable, tested configuration
  • Minimal risk approach

Implementation:

// build.gradle.kts
dependencies {
    implementation(platform("com.google.firebase:firebase-bom:33.0.0"))  // Last KTX version
    implementation("com.google.firebase:firebase-auth-ktx")
    implementation("com.google.firebase:firebase-firestore-ktx")
    implementation("com.google.firebase:firebase-analytics-ktx")
    implementation("com.google.firebase:firebase-crashlytics-ktx")
}

With Version Catalog:

# gradle/libs.versions.toml
[versions]
firebase-bom = "33.0.0"
 
[libraries]
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebase-bom" }
firebase-auth-ktx = { group = "com.google.firebase", name = "firebase-auth-ktx" }
firebase-firestore-ktx = { group = "com.google.firebase", name = "firebase-firestore-ktx" }
// build.gradle.kts
dependencies {
    implementation(platform(libs.firebase.bom))
    implementation(libs.firebase.auth.ktx)
    implementation(libs.firebase.firestore.ktx)
}

Pros:

  • No code changes required
  • Proven stable configuration
  • Lower risk
  • Keeps working version catalog syntax

Cons:

  • Eventually must migrate (Firebase will stop supporting 33.x)
  • Missing newer Firebase features from 34.x+
  • Technical debt accumulation

Archery Apprentice Decision: We chose this strategy for PR #269 to unblock development. Migration to 34.x+ scheduled for future work.


When to Use:

  • New projects starting from scratch
  • Planned refactoring window available
  • Want latest Firebase features
  • Future-proof configuration

Migration Steps:

Step 1: Update BOM Version

- implementation(platform("com.google.firebase:firebase-bom:33.0.0"))
+ implementation(platform("com.google.firebase:firebase-bom:34.6.0"))

Step 2: Remove -ktx Suffixes

- implementation("com.google.firebase:firebase-auth-ktx")
+ implementation("com.google.firebase:firebase-auth")
 
- implementation("com.google.firebase:firebase-firestore-ktx")
+ implementation("com.google.firebase:firebase-firestore")
 
- implementation("com.google.firebase:firebase-analytics-ktx")
+ implementation("com.google.firebase:firebase-analytics")
 
- implementation("com.google.firebase:firebase-crashlytics-ktx")
+ implementation("com.google.firebase:firebase-crashlytics")

Step 3: Update Version Catalog (If Used)

# gradle/libs.versions.toml
[versions]
- firebase-bom = "33.0.0"
+ firebase-bom = "34.6.0"
 
[libraries]
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebase-bom" }
- firebase-auth-ktx = { group = "com.google.firebase", name = "firebase-auth-ktx" }
+ firebase-auth = { group = "com.google.firebase", name = "firebase-auth" }
- firebase-firestore-ktx = { group = "com.google.firebase", name = "firebase-firestore-ktx" }
+ firebase-firestore = { group = "com.google.firebase", name = "firebase-firestore" }

Step 4: No Code Changes Required

Important: The Kotlin extension APIs are the same in both modules. Your application code does NOT need to change.

Example - Code Unchanged:

// This code works with BOTH -ktx and non-ktx modules
val auth = Firebase.auth
auth.signInWithEmailAndPassword(email, password).await()
 
val firestore = Firebase.firestore
val doc = firestore.collection("users").document(userId).get().await()

The extension functions (await(), Firebase.auth, etc.) are now in the main modules, so imports and usage remain identical.

Pros:

  • Latest Firebase features
  • Future-proof
  • Official recommended approach
  • Cleaner dependency list

Cons:

  • Requires updating all Firebase dependencies at once
  • Must update version catalog entries
  • Testing required to verify no regressions
  • Slightly risky if done mid-sprint

Impact on Gradle Version Catalogs

The Confusion This Caused

During PR #269 debugging, we initially believed the Gradle version catalog syntax was incorrect because:

  1. Version catalog syntax looked unusual (no versions for individual libraries)
  2. Build failed with empty version strings
  3. Stack Overflow had conflicting advice about version catalogs + BOMs

What We Learned:

  • ✅ Version catalog syntax was CORRECT
  • ❌ Problem was using BOM 34.x with -ktx libraries that don’t exist in that BOM

Correct Version Catalog + BOM Pattern

This pattern DOES work (when libraries exist in BOM):

# gradle/libs.versions.toml
[versions]
firebase-bom = "33.0.0"  # Or 34.6.0 with non-ktx libraries
 
[libraries]
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebase-bom" }
firebase-auth-ktx = { group = "com.google.firebase", name = "firebase-auth-ktx" }  # No version!
firebase-firestore-ktx = { group = "com.google.firebase", name = "firebase-firestore-ktx" }  # No version!
// build.gradle.kts
dependencies {
    implementation(platform(libs.firebase.bom))  // BOM provides versions
    implementation(libs.firebase.auth.ktx)       // Version from BOM
    implementation(libs.firebase.firestore.ktx)  // Version from BOM
}

Key Rules:

  1. BOM entry: Must have version.ref or explicit version
  2. Individual libraries: Must NOT have versions (BOM provides them)
  3. Library names: Must match what’s in the BOM (e.g., -ktx in BOM 33.x, no -ktx in 34.x)
  4. Platform declaration: Must use platform(libs.firebase.bom)

Related Documentation:


Troubleshooting

Error: Could not find com.google.firebase:firebase-X-ktx:.

Symptom:

Could not find com.google.firebase:firebase-analytics-ktx:.
                                                            ^
                                                            Empty version string

Diagnosis:

  1. Check your BOM version: grep firebase-bom gradle/libs.versions.toml or grep firebase-bom build.gradle.kts
  2. Check your dependencies: grep firebase-.*-ktx build.gradle.kts

If BOM >= 34.0.0 and using -ktx libraries:

Cause: BOM 34.x removed KTX libraries

Solutions:

  • Option A: Downgrade BOM to 33.0.0 (immediate fix)
  • Option B: Remove -ktx suffixes from all Firebase dependencies (migration required)

Error: Version Catalog Entry Not Found

Symptom:

> Could not find libs.firebase.auth.ktx

Diagnosis: Version catalog entry name doesn’t match what you’re referencing.

Solution: Check gradle/libs.versions.toml:

[libraries]
firebase-auth-ktx = { ... }  # Reference as: libs.firebase.auth.ktx
#         ^    ^                             dash    dot   dash dot

Gradle converts dashes in library names to dots in code.


Build Succeeds But Runtime Crashes

Symptom:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/auth/FirebaseAuthKtx;

Cause:

  • Using BOM 34.x (non-KTX)
  • Code imports KTX extension classes directly (rare, but possible)

Solution: Update imports to use main module classes:

- import com.google.firebase.auth.FirebaseAuthKtx
+ import com.google.firebase.auth.ktx.*  // Extension functions

Recommendations

For Archery Apprentice Project

Current Status (as of 2025-11-18):

  • Using Firebase BOM 33.0.0
  • All dependencies use -ktx suffix
  • Version catalog NOT used for Firebase (hardcoded strings)
  • Configuration stable and working

Recommended Next Steps:

Phase 1: Stay on BOM 33.0.0 (Current State)

  • No immediate changes required
  • Focus on feature development
  • Monitor Firebase release notes for BOM 33.x end-of-life announcement

Phase 2: Plan Migration to BOM 34.x+ (Future Sprint)

When ready to migrate:

  1. Create dedicated PR for Firebase migration

    • Title: deps: Migrate Firebase dependencies to non-KTX modules (BOM 34.x+)
    • Single-purpose PR, no other changes
  2. Update BOM version

    • 33.0.034.6.0 (or latest)
  3. Remove all -ktx suffixes

    • Update app/build.gradle.kts
    • Update shared/build.gradle.kts (KMP module using GitLive)
    • Verify no KTX references in version catalog
  4. Test thoroughly

    • Run all instrumented tests
    • Test Firebase Auth flows
    • Test Firestore queries
    • Test Analytics events
    • Test Crashlytics reporting
  5. Update documentation

    • Note BOM version in README
    • Document migration in CHANGELOG
    • Update this vault entry if issues found

Phase 3: Add Version Catalog Support (Optional)

Once stable on BOM 34.x, consider migrating Firebase dependencies to version catalog:

  • Centralized version management
  • Type-safe dependency references
  • Easier to update in future

External Resources

Official Firebase Documentation:

Gradle Documentation:

Related Project Documentation:

Community Resources:

  • GitHub Issue #17117 - Version catalogs + BOMs discussion
  • Stack Overflow: Search “firebase ktx deprecated” for latest community advice

Key Takeaways

  1. Firebase BOM 34.0.0+ removed all -ktx libraries in July 2025
  2. KTX APIs are still available in main modules (no code changes needed)
  3. Version catalog syntax is correct - problem was library availability in BOM
  4. Two valid strategies: Stay on BOM 33.x or migrate to 34.x+ (both work)
  5. This is a build configuration issue, not a code issue - application code unchanged
  6. Check external release notes when dependencies fail - tools aren’t always the problem

Status: Active guidance - BOM 33.0.0 in use, migration to 34.x+ planned for future sprint

Last Updated: 2025-11-18 Related PRs: #269 (Firebase BOM debugging) Week: 28 (iOS Firebase Integration + Dependency Updates)