Scott Kruse

    Scott Kruse

    10 months ago
    Seeing a crash related to compose not finding viewTreeLifecycleOwner, full stack trace in thread
    Fatal Exception: java.lang.IllegalStateException: ViewTreeLifecycleOwner not found from android.widget.FrameLayout{ad946f4 V.E...... ......ID 0,0-1080,2176 #7f0a0438 app:id/fragment_container aid=1073741828}
           at androidx.compose.ui.platform.WindowRecomposer_androidKt.createLifecycleAwareViewTreeRecomposer(WindowRecomposer.android.kt:244)
           at androidx.compose.ui.platform.WindowRecomposer_androidKt.access$createLifecycleAwareViewTreeRecomposer(WindowRecomposer.android.kt:1)
           at androidx.compose.ui.platform.WindowRecomposerFactory$Companion$LifecycleAware$1.createRecomposer(WindowRecomposer.android.kt:99)
           at androidx.compose.ui.platform.WindowRecomposerPolicy.createAndInstallWindowRecomposer$ui_release(WindowRecomposer.android.kt:155)
           at androidx.compose.ui.platform.WindowRecomposer_androidKt.getWindowRecomposer(WindowRecomposer.android.kt:230)
           at androidx.compose.ui.platform.AbstractComposeView.resolveParentCompositionContext(ComposeView.android.kt:220)
           at androidx.compose.ui.platform.AbstractComposeView.ensureCompositionCreated(ComposeView.android.kt:227)
           at androidx.compose.ui.platform.AbstractComposeView.onAttachedToWindow(ComposeView.android.kt:259)
           at android.view.View.dispatchAttachedToWindow(View.java:22010)
           at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4291)
           at android.view.ViewGroup.addViewInner(ViewGroup.java:6108)
           at android.view.ViewGroup.addView(ViewGroup.java:5884)
           at android.view.ViewGroup.addView(ViewGroup.java:5824)
           at androidx.fragment.app.FragmentStateManager.addViewToContainer(FragmentStateManager.java:830)
           at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:520)
           at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
           at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2177)
           at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2088)
           at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1990)
           at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
           at android.os.Handler.handleCallback(Handler.java:938)
           at android.os.Handler.dispatchMessage(Handler.java:99)
           at android.os.Looper.loop(Looper.java:246)
           at android.app.ActivityThread.main(ActivityThread.java:8633)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
    Anyone seen this recently?
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    10 months ago
    Are you in a fragment or an activity? Is it a platform fragment/activity or an androidx one? Which version of compose are you on?
    Scott Kruse

    Scott Kruse

    10 months ago
    Thanks for the response, I found a similar issue posted a few days ago in this thread where @Ian Lake recommended updating fragment to latest (which looks like we’re on an old version). Based on that thread idk if a bug was filed or not but I’ll get those contextual details and file one if one hasn’t been
    @Zach Klippenstein (he/him) [MOD] ++