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

JVM (Desktop) - Runtime error java.lang.NoSuchMethodError: 'android.os.Looper android.os.Handler.getLooper()' #700

Open
mdyaseen14 opened this issue Feb 1, 2025 · 0 comments

Comments

@mdyaseen14
Copy link

In Kotlin multiplatform added GitLive Firebase Kotlin SDK as below,

In build.gradle.kts (:composeApp) - Kotlin sources commonMain dependency
implementation(libs.bundles.firebase.mp)

Gradle versions file
`git-live-firebase="2.1.0"

[libraries]
firebase-mp-common = { module = "dev.gitlive:firebase-common", version.ref = "git-live-firebase" }
firebase-mp-auth = { module = "dev.gitlive:firebase-auth", version.ref = "git-live-firebase" }
firebase-mp-database = { module = "dev.gitlive:firebase-database", version.ref = "git-live-firebase" }
firebase-mp-firestore = { module = "dev.gitlive:firebase-firestore", version.ref = "git-live-firebase" }
firebase-mp-storage = { module = "dev.gitlive:firebase-storage", version.ref = "git-live-firebase" }

[bundles]
firebase-mp = ["firebase-mp-common", "firebase-mp-auth", "firebase-mp-database", "firebase-mp-firestore", "firebase-mp-storage"]
`

Following error occurs even in blank application
`
Caused by: java.lang.NoSuchMethodError: 'android.os.Looper android.os.Handler.getLooper()'

at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:358)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:134)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:68)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at androidx.lifecycle.MainDispatcherChecker.updateMainDispatcherThread(MainDispatcherChecker.desktop.kt:28)
at androidx.lifecycle.MainDispatcherChecker.isMainDispatcherThread(MainDispatcherChecker.desktop.kt:56)
at androidx.lifecycle.LifecycleRegistry_desktopKt.isMainThread(LifecycleRegistry.desktop.kt:20)
at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.jvm.kt:302)
at androidx.lifecycle.LifecycleRegistry.setCurrentState(LifecycleRegistry.jvm.kt:106)
at androidx.compose.ui.scene.ComposeContainer.updateLifecycleState(ComposeContainer.desktop.kt:463)
at androidx.compose.ui.scene.ComposeContainer.onWindowFocusChanged(ComposeContainer.desktop.kt:225)
at androidx.compose.ui.scene.ComposeContainer.setWindow(ComposeContainer.desktop.kt:317)
at androidx.compose.ui.scene.ComposeContainer.<init>(ComposeContainer.desktop.kt:185)
at androidx.compose.ui.scene.ComposeContainer.<init>(ComposeContainer.desktop.kt:84)
at androidx.compose.ui.awt.ComposeWindowPanel.<init>(ComposeWindowPanel.desktop.kt:52)
at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:66)
at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:64)
at androidx.compose.ui.window.Window_desktopKt$Window$3$1.invoke(Window.desktop.kt:183)
at androidx.compose.ui.window.Window_desktopKt$Window$3$1.invoke(Window.desktop.kt:181)
at androidx.compose.ui.window.Window_desktopKt$Window$13$1.invoke(Window.desktop.kt:605)
at androidx.compose.ui.window.Window_desktopKt$Window$13$1.invoke(Window.desktop.kt:604)
at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2$1.invoke(AwtWindow.desktop.kt:70)
at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2$1.invoke(AwtWindow.desktop.kt:69)
at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:82)
at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1364)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:992)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1013)
at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:1150)
at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:649)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:635)
at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:221)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith$$$capture(ContinuationImpl.kt:33)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at java.desktop/java.awt.event.InvocationEvent.dispatch$$$capture(Unknown Source)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

`

In MainDispatcherChecker.desktop.kt file isMainDispatcherThread() called, isMainDispatcherAvailable is true if firebase added and fails.

If firebase dependency removed working ok. Kindly resolve.

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

No branches or pull requests

1 participant