0

I have Error while launching app. My code has no error still I am getting this Error. Help me how to fix it.

android.view.InflateException: Binary XML file line #15: Binary XML file line #19: Error inflating class fragment

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/app_bar_main1">

    <fragment
        android:id="@+id/nav_host_fragment_content_main1"
        android:name="androidx.navigation.fragment.NavHostFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:defaultNavHost="true"                        <---- THIS IS 15
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navGraph="@navigation/mobile_navigation" />   <----THIS IS 19

</androidx.constraintlayout.widget.ConstraintLayout>

2 Answers2

0

I finally found the real problem. I had problem with viewmodel. This error occured because there was logical error in fragment

0

LinkajaBEN crashed android.view.InflateException:Binary XML file Line #15:Binary XML file Line #15:Error inflating class module.corecustomer.basepresentation.widge.OfflineModeWidget Caused by:android.view.InflateException:Binary XML file Line #15:Error inflating class module.corecustomer.basepresentation.widge.OfflineModeWidget Caused by:java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method)

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 23 '22 at 05:52