Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions firebase-sessions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

* [changed] Add warning for known issue b/328687152
* [changed] Use Dagger for dependency injection
* [changed] Updated datastore dependency to `1.1.3` to
fix [CVE-2024-7254](https://github.com/advisories/GHSA-735f-pc8j-v9w8).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
package com.google.firebase.sessions

import android.content.Context
import android.util.Log
import androidx.annotation.Keep
import androidx.datastore.preferences.preferencesDataStore
import com.google.android.datatransport.TransportFactory
import com.google.firebase.FirebaseApp
import com.google.firebase.annotations.concurrent.Background
Expand Down Expand Up @@ -69,6 +71,7 @@ internal class FirebaseSessionsRegistrar : ComponentRegistrar {
)

private companion object {
const val TAG = "FirebaseSessions"
const val LIBRARY_NAME = "fire-sessions"

val appContext = unqualified(Context::class.java)
Expand All @@ -78,5 +81,29 @@ internal class FirebaseSessionsRegistrar : ComponentRegistrar {
val blockingDispatcher = qualified(Blocking::class.java, CoroutineDispatcher::class.java)
val transportFactory = unqualified(TransportFactory::class.java)
val firebaseSessionsComponent = unqualified(FirebaseSessionsComponent::class.java)

init {
try {
::preferencesDataStore.javaClass
} catch (ex: NoClassDefFoundError) {
Log.w(
TAG,
"""
Your app is experiencing a known issue in the Android Gradle plugin, see https://issuetracker.google.com/328687152

It affects Java-only apps using AGP version 8.3.2 and under. To avoid the issue, either:

1. Upgrade Android Gradle plugin to 8.4.0+
Follow the guide at https://developer.android.com/build/agp-upgrade-assistant

2. Or, add the Kotlin plugin to your app
Follow the guide at https://developer.android.com/kotlin/add-kotlin

3. Or, do the technical workaround described in https://issuetracker.google.com/issues/328687152#comment3
"""
.trimIndent(),
)
}
}
}
}
Loading