skydoves / server-driven-compose

🧙 Server Driven Compose showcases server-driven UI approaches in Jetpack Compose with Firebase.
Apache License 2.0
291 stars 11 forks source link

The project crashes on startup #1

Closed ashtanko closed 2 months ago

ashtanko commented 2 months ago

Getting error in app start:

Gradle version:

8.7

Android Studio:

Ladybug | 2024.2.1 Canary 9

Devices:

Google Pixel 9 Pro XL & Google Pixel 7 Pro and Emulator

The error stack-trace:

java.lang.IllegalStateException: Default FirebaseApp is not initialized in this 
process io.getstream.server.driven.compose. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(FirebaseApp.java:179)
at com.google.firebase.database.FirebaseDatabase.getInstance(FirebaseDatabase.java:71)
at com.google.firebase.database.DatabaseKt.database(Database.kt:36)
at io.getstream.server.driven.core.network.di.NetworkModule.provideDatabaseReference(NetworkModule.kt:36)

The following code does not resolve the issue:

@HiltAndroidApp
class ServerDrivenApp : Application() {
  override fun onCreate() {
    super.onCreate()
    FirebaseApp.initializeApp(this)
  }
}
ashtanko commented 2 months ago

Update: this happens because the file google-services.json does not exist The issue can be closed