Firebase BOM and firebase-analytics were on the classpath, Firebase.analytics
was instantiated in MainActivity.onCreate, but no events were ever logged, and
neither Crashlytics nor Performance Monitoring were wired in. Crash reports and
performance traces from production Android devices were not reaching the Firebase
console.
Three independent gaps:
setAnalyticsCollectionEnabled,
no setUserId, no logEvent calls.A secondary AGP 9.x compatibility issue surfaced while wiring this: the
com.google.firebase.firebase-perf Gradle plugin (v2.0.0) still depends on the
removed AGP Transform API and refuses to apply on AGP 9.x with
Could not generate a decorated class for type FirebasePerfPlugin … com/android/build/api/transform/Transform.
androidApp/build.gradle.kts — added firebase-crashlytics, firebase-perf, and
the com.google.firebase.crashlytics Gradle plugin (the perf plugin is
intentionally not applied; see Prevention). gradle/libs.versions.toml
gained matching version refs.
A new androidApp/src/main/kotlin/krill/zone/FirebaseInitializer.kt is the single
init point: called from KrillApplication.onCreate, it explicitly enables
collection on all three services, sets installId() as the user identifier and
custom key (so an event, crash, and trace from the same device line up in the
console), logs app_open once at cold start, and subscribes to
AppLifecycle.isForeground to log app_open/app_background on each transition.
MainActivity now wraps its Compose setup in a manual activity_startup
performance trace.
_app_start metric, and HTTP request monitoring through
FirebasePerformance-aware OkHttp interceptors when added). Re-apply
alias(libs.plugins.firebasePerf) once a release lands; track upstream at
https://github.com/firebase/firebase-android-sdk and the firebase-perf plugin
changelog.FirebaseInitializer. Adding a new service
(Remote Config, Messaging, App Check) means adding a lateinit var + an
init call there, not sprinkling getInstance() calls across activities.firebase-analytics-ktx shim. BOM 33+ moved the KTX
contents into the main libraries; the shim still ships but its imports
(com.google.firebase.ktx.Firebase, com.google.firebase.analytics.ktx.analytics)
are deprecated and have moved between releases. Use FirebaseAnalytics.getInstance(context)
and a small Bundle helper instead.