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

Library is not compatible with moko permissions 0.18.0 #44

Closed
burnoo opened this issue Apr 19, 2024 · 4 comments · Fixed by #50 or #51
Closed

Library is not compatible with moko permissions 0.18.0 #44

burnoo opened this issue Apr 19, 2024 · 4 comments · Fixed by #50 or #51
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@burnoo
Copy link
Contributor

burnoo commented Apr 19, 2024

moko-geo is crashing when used with moko-permissions 0.18.0 due to changes introduced in icerockdev/moko-permissions#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.

@DenisV94
Copy link

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

@JakkeJ
Copy link

JakkeJ commented May 28, 2024

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.

@burnoo
Copy link
Contributor Author

burnoo commented Jul 6, 2024

I've opened a PR (#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")

@Alex009 Alex009 added this to the 0.7.0 milestone Jul 7, 2024
@Alex009 Alex009 linked a pull request Sep 22, 2024 that will close this issue
Alex009 added a commit that referenced this issue Sep 22, 2024
@Alex009 Alex009 added the enhancement New feature or request label Sep 22, 2024
@Alex009
Copy link
Member

Alex009 commented Sep 22, 2024

will be released in 0.7.0

@Alex009 Alex009 closed this as completed Sep 22, 2024
@Alex009 Alex009 mentioned this issue Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants