title: Android resource linking failed activity_main.xml:19: error: attribute android:defaultNavHost not found after adding navigation components
body: <p>Recently I have been pretty much excited about new exciting android tools. Among them Navigation literialy hooked me up. I thought this <a href="https://codelabs.developers.google.com/codelabs/android-navigation/index.html?index=..%2F..%2Findex#2" rel="nofollow noreferrer">code lab</a> would be wonderful to get started. Nonetheless, as an absolute beginner I found it a bit intriguing as it didn't state anything about step-by-step of setting up navigation components. So I started to break it up into bite sized section and start implementing it into a separate project.</p>
  
  <p>My main activity code</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
  
   override fun onCreate(savedInstanceState: Bundle?) {
   super.onCreate(savedInstanceState)
   setContentView(R.layout.activity_main)
  
  setSupportActionBar(toolbar)
  }
  
  override fun onSupportNavigateUp(): Boolean =
    findNavController(R.id.my_nav_host_fragment).navigateUp()
  }
  </code></pre>
  
  <p>in my main activity layout</p>
  
  <pre><code>&lt;fragment
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:id="@+id/my_nav_host_fragment"
    android:name="androidx.navigation.fragment.NavHostFragment"
    android:navGraph="@navigation/mobile_navigation"
    android:defaultNavHost="true"
    /&gt;
  </code></pre>
  
  <p>after this log shows error<a href="https://i.stack.imgur.com/Ge79T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ge79T.png" alt="enter image description here"></a></p>