Skip to content Skip to sidebar Skip to footer

Error Inflating Class Fragment When Testing Fragment Using Databinding

Can someone help me on this? In my test I want to check if the login button is displayed on the StartPage. I've been struggling with this error for a while today and I don't know h

Solution 1:

There is android:name attribute missing from <fragment> tag in your activity_start.xml

As per the docs, you must include it.

So your activity.start.xml should look like this:

<fragment xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/fragment"android:name="io.turbela.turbela.StartActivityFragment"android:layout_width="match_parent"android:layout_height="match_parent"/>

Note:

The class= attribute you are trying to use is for custom Views as in here

Post a Comment for "Error Inflating Class Fragment When Testing Fragment Using Databinding"