title: e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors
body: <p>I have enabled databinding, but while I execute the code I get this error.</p>
  
  <h2>error</h2>
  
  <p>e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors.</p>
  
  <p>I created a fragment class and XML for that class.
  Im able to import datbindingutil class.</p>
  
  <p>I have done rebuilt/ sync with gradle files/ invalidate cache and restart, nothing worked. </p>
  
  <h2>xml</h2>
  
  <pre><code>&lt;layout&gt;
  
  &lt;!--suppress AndroidUnknownAttribute --&gt;
  &lt;data class=".databinding.ProfileFragmentBinding"&gt;
  
      &lt;variable
          name="user"
          type="com.sample.sample.user.User" /&gt;
  
      &lt;variable
          name="vm"
          type="com.sample.sample.user.UserViewModel" /&gt;
  
      &lt;variable
          name="handler"
          type="com.sample.sample.user.profile.ProfileFragment" /&gt;
  &lt;/data&gt;
  
  
  &lt;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"&gt;
  
      &lt;de.hdodenhof.circleimageview.CircleImageView
          android:id="@+id/profileIV"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="@dimen/medium"
          android:layout_marginTop="@dimen/medium"
          android:contentDescription="@null"
          android:src="@mipmap/ic_launcher_round"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:url="@{user.avatarUrl}" /&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:orientation="vertical"
          app:layout_constraintBottom_toBottomOf="@+id/profileIV"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/profileIV"&gt;
  
          &lt;TextView
              android:id="@+id/profileNameLabel"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:fontFamily="@font/myriad_pro_semibold"
              android:text="@{user.name}"
              android:textColor="@color/black_transparent_de"
              android:textSize="@dimen/text_regular"
              tools:text="NAME" /&gt;
  
          &lt;TextView
              android:id="@+id/badgeLabel"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="5dp"
              android:fontFamily="@font/myriad_pro_semibold"
              android:text="@{user.badge}"
              android:textColor="@color/grey_000000"
              android:textSize="@dimen/text_regular"
              tools:text="Superman" /&gt;
  
          &lt;TextView
              android:id="@+id/profile_Label"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="5dp"
              android:fontFamily="@font/roboto_bold"
              android:text="@{user.badge}"
              android:textColor="@color/green_39b54a"
              android:textSize="@dimen/text_small"
              tools:text="farmer_v1" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;ImageView
          android:id="@+id/badgeIV"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginEnd="@dimen/medium"
          android:layout_marginTop="@dimen/medium"
          android:contentDescription="@null"
          android:src="@mipmap/ic_launcher"
          app:error="@{@drawable/ic_profile_default_grey_24dp}"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:placeholder="@{@drawable/ic_profile_default_grey_24dp}"
          app:url="@{user.badgeUrl}" /&gt;
  
      &lt;ImageView
          android:id="@+id/locationPinIV"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="@dimen/medium"
          android:contentDescription="@null"
          android:src="@drawable/ic_location_pin"
          app:layout_constraintStart_toStartOf="@+id/profileIV"
          app:layout_constraintTop_toBottomOf="@+id/profileIV" /&gt;
  
      &lt;TextView
          android:id="@+id/profileAddressTV"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="@dimen/narrow"
          android:fontFamily="@font/roboto"
          android:textColor="@color/grey_000000"
          app:layout_constraintBottom_toBottomOf="@+id/locationPinIV"
          app:layout_constraintLeft_toRightOf="@+id/locationPinIV"
          app:layout_constraintTop_toTopOf="@+id/locationPinIV"
          tools:text="bangalore, Karnataka" /&gt;
  
      &lt;ImageView
          android:id="@+id/dobIV"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="@dimen/standard"
          android:layout_marginTop="@dimen/medium"
          android:contentDescription="@null"
          android:src="@drawable/ic_dob"
          app:layout_constraintLeft_toRightOf="@+id/profileAddressTV"
          app:layout_constraintTop_toBottomOf="@+id/profileIV" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="@dimen/narrow"
          android:fontFamily="@font/roboto"
          android:textColor="@color/grey_000000"
          app:layout_constraintBottom_toBottomOf="@+id/locationPinIV"
          app:layout_constraintLeft_toRightOf="@+id/dobIV"
          app:layout_constraintTop_toTopOf="@+id/locationPinIV"
          tools:text="born on 01/01/2000" /&gt;
  
      &lt;TextView
          android:id="@+id/activityLabel"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="@dimen/big"
          android:fontFamily="@font/myriad_pro_semibold"
          android:text="@string/activities"
          android:textColor="@color/black_transparent_de"
          android:textSize="@dimen/text_regular"
          app:layout_constraintStart_toStartOf="@+id/profileIV"
          app:layout_constraintTop_toBottomOf="@+id/locationPinIV" /&gt;
  
      &lt;View
          android:id="@+id/dividerV"
          android:layout_width="match_parent"
          android:layout_height="1dp"
          android:layout_marginEnd="@dimen/small"
          android:layout_marginStart="@dimen/small"
          android:layout_marginTop="@dimen/regular"
          android:background="@color/grey_000000"
          app:layout_constraintTop_toBottomOf="@+id/activityLabel" /&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          app:layout_constraintTop_toBottomOf="@+id/dividerV"&gt;
  
          &lt;!--&lt;com.google.android.material.tabs.TabLayout
              android:id="@+id/tablayout"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              app:pager="@{(pager)}"
              app:tabGravity="fill"
              app:tabIndicatorColor="@color/black"
              app:tabMode="fixed"
              app:tabSelectedTextColor="@color/black"
              app:tabTextAppearance="@style/CustomTextTab"
              app:tabTextColor="#b4ffffff" /&gt;
  
          &lt;androidx.viewpager.widget.ViewPager
              android:id="@+id/viewpager"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/tablayout"
              app:handler="@{handler}"
              app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;--&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p></p>
  
  <h2>class</h2>
  
  <pre><code>    class ProfileFragment : Fragment() {
      @Inject
      lateinit var mFactory: ViewModelProvider.Factory
      private lateinit var mBinding: ProfileFragmentBinding
  
      override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
          mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_profile, container, false);
          return mBinding.root
      }
  
      override fun onActivityCreated(savedInstanceState: Bundle?) {
          super.onActivityCreated(savedInstanceState)
          val vm: UserViewModel = getViewModel(mFactory)
          mBinding.vm = vm
          //mBinding.handler = this
          //mBinding.setLifecycleOwner(this)
      }
  
      /*@BindingAdapter("bind:handler")
      fun bindViewPagerAdapter(view: ViewPager, activity: MainActivity) {
          val adapter = ProfilePagerAdapter(view.context, activity.supportFragmentManager)
          view.adapter = adapter
      }
  
      @BindingAdapter("bind:pager")
      fun bindViewPagerTabs(view: TabLayout, pagerView: ViewPager) {
          view.setupWithViewPager(pagerView, true)
      }*/
  }
  </code></pre>