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

Crash: Already attached to lifecycleOwner #909

Closed
Henmeva opened this issue Mar 30, 2022 · 2 comments
Closed

Crash: Already attached to lifecycleOwner #909

Henmeva opened this issue Mar 30, 2022 · 2 comments

Comments

@Henmeva
Copy link

Henmeva commented Mar 30, 2022

Double click "Following"/"Watched"/"Search" tabs:

    Process: app.tivi.debug, PID: 18884
    java.lang.IllegalStateException: Already attached to lifecycleOwner
        at androidx.lifecycle.SavedStateHandleController.attachToLifecycle(SavedStateHandleController.java:38)
        at androidx.lifecycle.SavedStateHandleAttacher.onRecreated(SavedStateHandleSupport.kt:139)
        at androidx.savedstate.Recreator.reflectiveNew(Recreator.java:90)
        at androidx.savedstate.Recreator.onStateChanged(Recreator.java:62)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
        at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:271)
        at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:313)
        at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:151)
        at androidx.lifecycle.LifecycleRegistry.setCurrentState(LifecycleRegistry.java:121)
        at androidx.navigation.NavBackStackEntry.updateState(NavBackStackEntry.kt:188)
        at androidx.navigation.NavBackStackEntry.setMaxLifecycle(NavBackStackEntry.kt:154)
        at androidx.navigation.NavController.updateBackStackLifecycle$navigation_runtime_release(NavController.kt:987)
        at androidx.navigation.NavController.dispatchOnDestinationChanged(NavController.kt:892)
        at androidx.navigation.NavController.navigate(NavController.kt:1726)
        at androidx.navigation.NavController.navigate(NavController.kt:1658)
        at androidx.navigation.NavController.navigate(NavController.kt:1980)
        at androidx.navigation.NavController.navigate$default(NavController.kt:1975)
        at androidx.navigation.NavController.navigate(NavController.kt:1961)
        at app.tivi.home.HomeKt$Home$2$1.invoke(Home.kt:118)
        at app.tivi.home.HomeKt$Home$2$1.invoke(Home.kt:115)
        at app.tivi.home.HomeKt$HomeBottomNavigation$1$1$1$1.invoke(Home.kt:232)
        at app.tivi.home.HomeKt$HomeBottomNavigation$1$1$1$1.invoke(Home.kt:232)
        at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke-k-4lQ0M(Clickable.kt:153)
        at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke(Clickable.kt:142)
        at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:223)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
        at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
        at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:509)
        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:404)
        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:417)
        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:310)
        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
        at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:179)
        at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:98)
        at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:80)
        at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1223)
2022-03-30 16:26:20.898 18884-18884/app.tivi.debug E/AndroidRuntime:     at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1173)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1113)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
        at android.app.Activity.dispatchTouchEvent(Activity.java:4196)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
        at android.view.View.dispatchPointerEvent(View.java:14799)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6344)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6145)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5623)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5680)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5646)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5811)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5654)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5868)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5627)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5680)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5646)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5654)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5627)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8558)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8509)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8478)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8681)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:335)
        at android.os.Looper.loopOnce(Looper.java:161)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7842)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)```
@phillipsk
Copy link
Contributor

HomeBottomNavigation(
    selectedNavigation = currentSelectedItem,
    onNavigationSelected = { selected ->
        if (selected.route == currentSelectedItem.route) {
            return@HomeBottomNavigation
        }

https://stackoverflow.com/questions/71361999/jetpack-compose-bottomnavigation-java-lang-illegalstateexception-already-atta

? This is an option

@chrisbanes
Copy link
Owner

chrisbanes commented Feb 9, 2023

I'm not seeing this in Crashlytics, so closing this. Feel free to re-open if it's still happening

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

3 participants