title: Fragment NavHostFragment did not create a view
body: <p>I couldn’t catch this problem personally, but there are a lot of such errors on Firebase Crashlytics</p>
  
  <p><a href="https://i.stack.imgur.com/x8YZC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/x8YZC.png" alt="enter image description here"></a></p>
  
  <p>I tried all the answers with StackOverflow but nothing helped</p>
  
  <p><a href="https://i.stack.imgur.com/UYdQY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UYdQY.png" alt="enter image description here"></a></p>
  
  <p>My R.layout.activity_main</p>
  
  <pre><code>&lt;fragment
      android:id="@+id/nav_host_fragment"
      android:name="androidx.navigation.fragment.NavHostFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:defaultNavHost="true"
      app:navGraph="@navigation/main_graph"/&gt;
  </code></pre>
  
  <p>My navigation/main_graph</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;navigation xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tols"
      xmlns:tools2="http://schemas.android.com/tools"
      android:id="@+id/main_graph"
      app:startDestination="@id/ordersFragment"&gt;
  
      &lt;fragment
          android:id="@+id/ordersFragment"
          android:name="com.app.package.ui.orders.view.OrdersFragment"
          android:label="@string/menu_orders"
          tools:layout="@layout/fragment_orders"&gt;
      &lt;action
          android:id="@+id/action_ordersFragment_to_orderFragment"
          app:destination="@id/orderFragment" /&gt;
      &lt;action
          android:id="@+id/action_ordersFragment_to_problemFragment"
          app:destination="@id/problemFragment" /&gt;
      &lt;action
          android:id="@+id/action_ordersFragment_to_settingsFragment"
          app:destination="@id/settingsFragment" /&gt;
      &lt;/fragment&gt;
  
      &lt;fragment
          android:id="@+id/problemFragment"
          android:name="com.app.package.ui.problem.ProblemFragment"
          android:label="@string/menu_problems" /&gt;
  
      &lt;fragment
          android:id="@+id/orderFragment"
          android:name="com.app.package.ui.order.view.OrderFragment"
          android:label="OrderFragment"&gt;
      &lt;action
          android:id="@+id/action_orderFragment_to_compositionFragment"
          app:destination="@id/compositionFragment" /&gt;
      &lt;action
          android:id="@+id/action_orderFragment_to_selectCheckDialog"
          app:destination="@id/selectCheckDialog" /&gt;
      &lt;/fragment&gt;
  
      &lt;fragment
          android:id="@+id/compositionFragment"
          android:name="com.app.package.ui.composition.CompositionFragment"
          android:label="fragment_composition"
          tools2:layout="@layout/fragment_composition" /&gt;
  
      &lt;fragment
          android:id="@+id/settingsFragment"
          android:name="com.app.package.ui.settings.SettingsFragment"
          android:label="fragment_settings"
          tools2:layout="@layout/fragment_settings" /&gt;
  
      &lt;fragment
          android:id="@+id/selectCheckDialog"
          android:name="com.app.package.ui.order.view.SelectCheckDialog"
          android:label="dialog_select_check"
          tools2:layout="@layout/dialog_select_check" /&gt;
  &lt;/navigation&gt;
  </code></pre>
  
  <p>My gradle</p>
  
  <pre><code>implementation 'androidx.navigation:navigation-fragment:2.2.0'
  implementation 'androidx.navigation:navigation-ui:2.2.0'
  </code></pre>
  
  <p>I tried different solutions but nothing helped. 
  Judging by Firebase Crashlytics 963 crash in 342 users.</p>