Closed StefMa closed 1 month ago
FirebasePlatform.initializeFirebasePlatform(object : FirebasePlatform() { val storage = mutableMapOf<String, String>() override fun store(key: String, value: String) = storage.set(key, value) override fun retrieve(key: String) = storage[key] override fun clear(key: String) { storage.remove(key) } override fun log(msg: String) = println(msg) })
this part should only be in desktopApp
Firebase.initialize(Application(), options)
also this part needs to pass the android context on android instead of Application()
, or you can put all of this in desktopApp and use the Firebase configuration file on Android
Thank you for the quick response! That makes sense. I will give it a try and report back if it works π
Nice, it works. Thanks again!
I guess it make sense to adjust the docs in the java-sdk repo π
I have a Kotlin Multiplatform project. The file tree loks like this:
While the shared depencenies has that:
My androidApp has a single dependency to the
shared
project, and the build.gradle.kts uses thekotlin("android")
plugin.Inside my shared project I have the following
Application.init
function:My androidApp tries to call this in their own android.app.Application().
However, when I try to compile the app (
./gradlew assembleDebug
) I get these:Does anyone know why this happen? π€ Do I something wrong?
Btw, my
desktopApp
works fine without any issues. There, mymain.kt
looks like this:Everything compiles and runs correctly. But for the Android target something is missing for whatever reasons.