title: Jetpack Compose inside Fragment ViewTreeLifecycleOwner not found from ConstraintLayout
body: <p>I'm getting <code>IllegalStateException</code> error while using Compose in my fragment.</p>
  <blockquote>
  <p>java.lang.IllegalStateException: ViewTreeLifecycleOwner not found from
  androidx.constraintlayout.widget.ConstraintLayout</p>
  </blockquote>
  <p>The activity is AppCompatActivity:</p>
  <pre><code>class MainActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
      }
  }
  </code></pre>
  <p>I'm using <code>Navigation Component</code> to navigate between fragments. and this is Activities XML:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.MainActivity&quot;&gt;
  
      &lt;androidx.fragment.app.FragmentContainerView
          android:id=&quot;@+id/appContent&quot;
          android:name=&quot;androidx.navigation.fragment.NavHostFragment&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          app:defaultNavHost=&quot;true&quot;
          app:navGraph=&quot;@navigation/main_navigation_graph&quot; /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p>And Fragment:</p>
  <pre><code>class WelcomeFragment : Fragment() {
      override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View {
          return ComposeView(requireContext()).apply {
              setViewCompositionStrategy(
                  DisposeOnLifecycleDestroyed(viewLifecycleOwner)
              )
  
              setContent {
                  MaterialTheme {
                      Text(text = &quot;Welcome to App&quot;)
                  }
              }
          }
      }
  }
  </code></pre>
  <p>Dependencies and versions:</p>
  <pre><code>FragmentVersion = '1.3.3'
  CONSTRAINT_LAYOUT_VERSION = '2.1.0'
  KOTLIN_VERSION = '1.5.21'
  ACTIVITY_KTX_VERSION = '1.3.1'
  
  COMPOSE_VERSION = '1.0.0'
  COMPOSE_ACTIVITY = '1.3.1'
  COMPOSE_VIEWMODEL = '1.0.0-alpha07'
  COMPOSE_CONSTRAINT_VERSION = '1.0.0-beta02'
  APP_COMPAT_VERSION = '1.3.1'
  </code></pre>