Error inflating class androidx.fragment.app.FragmentContainerView // Android Kotlin Dev Diary

The cause of error in Logcat:

     Caused by: android.view.InflateException: Binary XML file line #9 in net.catzie.sampleapp:layout/activity_main: Binary XML file line #9 in net.catzie.sampleapp:layout/activity_main: Error inflating class androidx.fragment.app.FragmentContainerView
     Caused by: android.view.InflateException: Binary XML file line #9 in net.catzie.sampleapp:layout/activity_main: Error inflating class androidx.fragment.app.FragmentContainerView
     Caused by: java.lang.IllegalStateException: no start destination defined via app:startDestination for net.catzie.sampleapp:id/nav_graph

The fix was to add a startDestination to <navigation> tag in the nav_graph.xml.

Related Posts

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *