moko-geo icon indicating copy to clipboard operation
moko-geo copied to clipboard

Library is not compatible with moko permissions 0.18.0

Open burnoo opened this issue 10 months ago • 3 comments

moko-geo is crashing when used with moko-permissions 0.18.0 due to changes introduced in https://github.com/icerockdev/moko-permissions/pull/114

Crash

java.lang.NoSuchMethodError: No interface method bind(Landroidx/lifecycle/Lifecycle;Landroidx/fragment/app/FragmentManager;)V in class Ldev/icerock/moko/permissions/PermissionsController; or its super classes (declaration of 'dev.icerock.moko.permissions.PermissionsController' appears in /data/app/~~mzYr2CSSRJBzdyXB69qEMw==/house.letmein.app.debug-L3ibmEofzpfG5nL4uKKVAA==/base.apk!classes25.dex)
        at dev.icerock.moko.geo.LocationTracker.bind(LocationTracker.kt:46)
        at dev.icerock.moko.geo.compose.BindLocationTrackerEffect_androidKt$BindLocationTrackerEffect$1.invokeSuspend(BindLocationTrackerEffect.android.kt:26)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
        at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
        at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
        at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
        at android.os.Handler.handleCallback(Handler.java:958)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:205)
        at android.os.Looper.loop(Looper.java:294)
        at android.app.ActivityThread.main(ActivityThread.java:8177)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
        Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@1f23d75, androidx.compose.runtime.BroadcastFrameClock@5c010a, StandaloneCoroutine{Cancelling}@739ad7b, AndroidUiDispatcher@e8c8798]

Workaround

Keep using moko-permissions 0.17.0 till moko-geo is updated

Fix

LocationTracker.bind and BindLocationTrackerEffect should be updated to adapt to a new PermissionsController.bind API. While releasing a new version of this library it would be nice to include also bumping other dependencies to the newest versions.

burnoo avatar Apr 19 '24 18:04 burnoo

Hello! I am facing the same error... Can you explain how you solved it please? Thanks you!

DenisV94 avatar May 24 '24 12:05 DenisV94

Same issue here, not solvable with Moko Permissions without an update to this library I think. Either make a custom permissions library that supports background location (since this is the big change in 0.18), or wait.

JakkeJ avatar May 28 '24 00:05 JakkeJ

I've opened a PR (https://github.com/icerockdev/moko-geo/pull/50)

I've also published the update to my public maven repository, so anyone can use it while waiting for the official release.

Installation

Add maven In settings.gradle.kts (read more about versioning here)

dependencyResolutionManagement {
    repositories {
        maven(url = "https://pkgs.dev.azure.com/burnoo/maven/_packaging/public/maven/v1") {
            content {
                includeVersionByRegex(".*", ".*", ".*-beap[0-9]+")
            }
        }
    }
}

In your module:

implementation("dev.icerock.moko:geo:0.6.1-beap1")

burnoo avatar Jul 06 '24 13:07 burnoo

will be released in 0.7.0

Alex009 avatar Sep 22 '24 07:09 Alex009