Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to Firebase BOM 33.8.0 #6629

Closed
wvdans6225 opened this issue Jan 17, 2025 · 7 comments
Closed

Updating to Firebase BOM 33.8.0 #6629

wvdans6225 opened this issue Jan 17, 2025 · 7 comments

Comments

@wvdans6225
Copy link

Android Studio version: 2024.2.2
Android Studio build: #AI-242.23726.103.2422.12816248, built on December 17, 2024
Component: Firebase Analytics
Component Version: I have not been specifying a version per documentation.

I tried updating Firebase BOM to version 33.8.0 this morning because Android studio reported an available update, and when I build my app I get an error indicating that com.google.firebase.analytics.analytics in imports and the Firebase.analytics call now both generate Unresolved Reference errors and the build fails.

To mitigate this problem I rolled back to version 33.7.0, and my app compiled without issue.

I noticed that the documentation for implementing Firebase and Firebase analytics found at https://firebase.google.com/docs/android/setup still indicates that 33.7.0 should be used.

@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@pmechenbier
Copy link

I am running into the exact same problem.

Android Studio version: 2024.2.2
Android Studio build: #AI-242.23726.103.2422.12816248, built on December 17, 2024
Component: Firebase Analytics
Component Version: I have not been specifying a version per documentation.

When I updated Firebase BOM to version 33.8.0 (com.google.firebase:firebase-bom) my app would not finish building. Same error as the original reporter, indicating that com.google.firebase.analytics.analytics in imports and the Firebase.analytics call now both generate Unresolved Reference errors and the build fails.

I rolled back to version 33.7.0, and my app built without issue.

@helios66
Copy link

I have the same problem too. 😅 Updating from 33.7.0 to 33.8.0 break the build as @pmechenbier and @wvdans6225 already pointed out.

@lehcar09
Copy link
Contributor

Hi folks! I tried reproducing the issue using the Android quickstart app for Google Analytics, however, I wasn't able to reproduce the issue.

Image

Can you share the repositories, plugins and dependencies you're using? Also, could you try clearing the cache and see if that helps?Thanks!

@wvdans6225
Copy link
Author

wvdans6225 commented Jan 20, 2025

Repositories:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}

From project Gradle:
plugins {
id("com.android.application") version "8.8.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
id("com.google.gms.google-services") version "4.4.2" apply false
id("com.google.firebase.crashlytics") version "3.0.2" apply false
id("com.google.firebase.firebase-perf") version "1.4.2" apply false
}

From module Gradle:
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("com.google.firebase.firebase-perf")
}

dependencies {

implementation("androidx.core:core-ktx:1.15.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
implementation("androidx.activity:activity-compose:1.10.0")
implementation(platform("androidx.compose:compose-bom:2025.01.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3:1.3.1")
implementation("androidx.compose.material:material-icons-extended:1.7.6")
implementation("androidx.navigation:navigation-compose:2.8.5")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
implementation("androidx.datastore:datastore-preferences:1.1.2")
implementation("com.android.volley:volley:1.2.1")
implementation("androidx.work:work-runtime-ktx:2.10.0")

implementation("com.google.android.gms:play-services-fitness:21.2.0")
implementation("com.google.android.gms:play-services-auth:21.3.0")

implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
implementation("com.google.firebase:firebase-installations")
implementation("com.google.firebase:firebase-messaging")
implementation("com.google.firebase:firebase-perf")
implementation("com.google.firebase:firebase-config")
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-crashlytics")

implementation("androidx.activity:activity-ktx:1.10.0")
implementation("androidx.fragment:fragment-ktx:1.8.5")
implementation("androidx.lifecycle:lifecycle-process:2.8.7")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2025.01.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.8"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

compileSdk 35
minSdk 28
targetSdk 35

Tried clearing all caches as first troubleshooting step, before submitting this ticket.

Note: I tried again this morning and pulled the attached screenshots.
Rollback to 33.7.0 again allowed successful build.

Image

Image

@wdx700
Copy link

wdx700 commented Jan 21, 2025

Hi all, changing kotlin version to 2.1.0 fixed this issue.

@lehcar09
Copy link
Contributor

Thank you for the details @wvdans6225. I was able to encounter the error.

The root cause, based on the logs, is an incompatible Kotlin version. Your project uses Kotlin 1.9.~, but the "play-services-measurement-api" (Google Analytics dependency) requires Kotlin 2.1.0.

Specifically, the following error appeared:

> Task :app:compileDebugKotlin
...gradle/caches/8.12/transforms/0a0c765d953f98b5c42cc5530554352a/transformed/play-services-measurement-api-22.2.0-api.jar\!/META-INF/java.com.google.android.gmscore.integ.client.measurement\_api\_measurement\_api.kotlin\_moduleModule was compiled with Kotlin 2.1.0, but version 1.9.0 was expected.

The issue was resolved after updating the Kotlin version to 2.1.0.

With that, I’ll be closing this issue now. Let me know if there’s any misunderstanding so we can reopen the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants