title: How to solve 'data binding is not enabled' error while using view binding
body: <p>I am using view binding and to do so I used the following code.</p>
  <pre><code>buildFeatures{ viewBinding true }
  </code></pre>
  <p>And I got this error:</p>
  <pre><code>&gt; [databinding] {&quot;msg&quot;:&quot;Found \u003clayout\u003e but data binding is not
  &gt; enabled.\n\nAdd buildFeatures.dataBinding \u003d true to your
  &gt; build.gradle to enable
  &gt; it.&quot;,&quot;file&quot;:&quot;C:\\Users\\akash\\AndroidStudioProjects\\NavigationSafeArgs\\app\\src\\main\\res\\layout\\fragment_home.xml&quot;,&quot;pos&quot;:[]}
  </code></pre>
  <p>After reading the thrown error I thought It is saying to enable <code>dataBinding</code> So I added <code>dataBinding true</code> too inside <code>buildFeatures</code>. Still It throws the same error.</p>
  <p>Here is my fragment_home.xml code;</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;layout&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:gravity=&quot;center&quot;
      android:orientation=&quot;vertical&quot;
      tools:context=&quot;.HomeFragment&quot;&gt;
  
      &lt;TextView
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginBottom=&quot;16dp&quot;
          android:text=&quot;@string/home_screen&quot;
          android:textAppearance=&quot;@style/TextAppearance.AppCompat.Large&quot; /&gt;
  
      &lt;Button
          android:id=&quot;@+id/button_login&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;@string/login&quot; /&gt;
  &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  
     
  </code></pre>