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

Error using androidx.activity.ComponentActivity #97

Closed
n1rocket opened this issue Dec 21, 2023 · 4 comments · Fixed by #114
Closed

Error using androidx.activity.ComponentActivity #97

n1rocket opened this issue Dec 21, 2023 · 4 comments · Fixed by #114
Milestone

Comments

@n1rocket
Copy link

My activity extend of androidx.activity.ComponentActivity.

is there any option to workaround?

java.lang.ClassCastException: com.company.component.ui.SActivity cannot be cast to androidx.fragment.app.FragmentActivity at dev.icerock.moko.permissions.compose.BindEffect_androidKt$BindEffect$1.invokeSuspend(BindEffect.android.kt:24) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) 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.doFrame(AndroidUiDispatcher.android.kt:68) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:967) at android.view.Choreographer.doCallbacks(Choreographer.java:793) at android.view.Choreographer.doFrame(Choreographer.java:724) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:954) at android.os.Handler.handleCallback(Handler.java:914) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7551) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@c4c4f7, androidx.compose.runtime.BroadcastFrameClock@5d54f64, StandaloneCoroutine{Cancelling}@55b75cd, AndroidUiDispatcher@f63ce82]

thanks!

@mcmendesuol
Copy link

mcmendesuol commented Dec 29, 2023

Me too, precisely moko-media from moko-permission this error

@omarzer0
Copy link

omarzer0 commented Jan 3, 2024

@n1rocket @mcmendesuol
You can just change what your MainActivity extends => Change ComponentActivity to FragmentActivity

@maeceloacm1998
Copy link

image when using your soluction @omarzer0, showing the this error

@omarzer0
Copy link

omarzer0 commented Jan 4, 2024

@maeceloacm1998
Could you please show the code?

@Alex009 Alex009 added this to the 0.18.0 milestone Apr 18, 2024
@Alex009 Alex009 linked a pull request Apr 18, 2024 that will close this issue
@Alex009 Alex009 closed this as completed Apr 19, 2024
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

Successfully merging a pull request may close this issue.

5 participants