title: Error: Cannot find symbol class CouponBindingImpl
body: <p>I am trying to make an android application that displays a list of coupons to the user to choose from using <code>RecyclerView</code>. I am trying to use <code>DataBinding</code> to bind the details of the coupons to a coupon XML template, and then those coupons to the <code>RecyclerView</code>. </p>
  
  <p>when I try to build, I keep on getting error: </p>
  
  <blockquote>
    <p>cannot find symbol class CouponItemBindingImpl </p>
  </blockquote>
  
  <p>Here is my XML code for the Coupon Item template:</p>
  
     
  
  <pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
  
  &lt;android.support.v7.widget.CardView
      android:id="@+id/card"
      android:layout_width="match_parent"
      android:layout_height="120dp"
      app:cardBackgroundColor="@android:color/transparent"
      app:cardCornerRadius="14dp"
      app:cardElevation="6dp"&gt;
  
  
      &lt;LinearLayout
          android:id="@+id/linearLayoutHorizontal"
          android:layout_width="match_parent"
          android:layout_height="120dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:orientation="horizontal"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"&gt;
  
          &lt;data xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              class="CouponItem"&gt;
              &lt;import type="com.example.mmcke.campuscoupons.model.Coupon"/&gt;
  
              &lt;variable
                  name="data"
                  type="Coupon" /&gt;
              &lt;import type="com.example.mmcke.campuscoupons.R"/&gt;
          &lt;/data&gt;
  
          &lt;LinearLayout
              android:id="@+id/linearLayout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_weight="1"
              android:orientation="vertical"&gt;
  
              &lt;TextView
                  android:id="@+id/name"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="@{data.name}"
                  android:textSize="24sp" /&gt;
  
              &lt;TextView
                  android:id="@+id/details"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="@{data.details}"
                  android:textSize="14sp" /&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>Here is the XML code for my main activity, the screen containing the <code>RecyclerView</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;layout xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:bind="http://schemas.android.com/apk/res-auto"&gt;
  
  &lt;data&gt;
      &lt;import type="com.example.mmcke.campuscoupons.model.Coupon"/&gt;
      &lt;variable
          name="data"
          type="Coupon"/&gt;
  
  &lt;/data&gt;
  
  &lt;android.support.constraint.ConstraintLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.mmcke.campuscoupons.controllers.MainActivity"&gt;
  
      &lt;TextView
          android:id="@+id/header"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:text="Campus Coupons"
          android:textSize="24sp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recyclerView"
          android:layout_width="368dp"
          android:layout_height="455dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/header"
          app:layoutManager="android.support.v7.widget.LinearLayoutManager"&gt;
      &lt;/android.support.v7.widget.RecyclerView&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  
  &lt;/layout&gt;
  </code></pre>
  
  <p>Here is the java code for my Main Activity:</p>
  
  <pre><code>package com.example.mmcke.campuscoupons.controllers;
  
  import android.content.Context;
  import android.databinding.BindingAdapter;
  import android.databinding.DataBindingUtil;
  import android.databinding.ViewDataBinding;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.ViewGroup;
  
  import com.example.mmcke.campuscoupons.BR;
  import com.example.mmcke.campuscoupons.R;
  import com.example.mmcke.campuscoupons.databinding.ActivityMainBinding;
  import com.example.mmcke.campuscoupons.model.Coupon;
  import com.example.mmcke.campuscoupons.model.CouponAdapter;
  import com.example.mmcke.campuscoupons.model.Model;
  import com.example.mmcke.campuscoupons.model.School;
  import com.example.mmcke.campuscoupons.databinding.CouponItemBinding;
  
  import java.util.ArrayList;
  
  public class MainActivity extends AppCompatActivity {
  
  private final Model model = Model.getInstance();
  private ArrayList&lt;Coupon&gt; coupons = new ArrayList&lt;Coupon&gt;();
  private ActivityMainBinding binding;
  private RecyclerView recyclerView;
  private CouponAdapter adapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
  
      coupons = getEnumFromString(School.class, model.getCurrentUser().getSchoolName()).getCoupons();
      recyclerView = (RecyclerView)findViewById(R.id.recyclerView);
      recyclerView.setLayoutManager(new LinearLayoutManager(this));
  
      adapter = new CouponAdapter(this, coupons);
      recyclerView.setAdapter(adapter);
  
  }
  
  @BindingAdapter({"entries", "layout"})
  public static &lt;Coupon&gt; void setEntries(ViewGroup viewGroup, ArrayList&lt;Coupon&gt; entries, int layoutID) {
      if (entries != null) {
          LayoutInflater inflater = (LayoutInflater)viewGroup.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          for (int i = 0; i &lt; entries.size(); i++) {
              Coupon entry = entries.get(i);
              ViewDataBinding binding = DataBindingUtil.inflate(inflater, layoutID, viewGroup, true);
              //binding.setVariable(BR.data, entry);
          }
      }
  }
  
  public static &lt;School extends Enum&lt;School&gt;&gt; School getEnumFromString (Class&lt;School&gt; c, String string) {
      if (c != null &amp;&amp; string != null) {
          try {
              return Enum.valueOf(c, string.trim().toUpperCase());
          } catch (IllegalArgumentException ex) {
  
          }
      }
      return null;
  }
  }
  </code></pre>
  
  <p>Here is the holder I made for my Coupon Item:</p>
  
  <pre><code>package com.example.mmcke.campuscoupons.model;
  
  import android.content.ClipData;
  import android.databinding.ViewDataBinding;
  import android.support.v7.widget.RecyclerView;
  import android.view.View;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.example.mmcke.campuscoupons.BR;
  import com.example.mmcke.campuscoupons.R;
  import com.example.mmcke.campuscoupons.databinding.ActivityMainBinding;
  import com.example.mmcke.campuscoupons.databinding.CouponItemBinding;
  
  
  /**
   *
   * A class to help with displaying coupons
   * Created by mmcke on 11/21/2018.
   */
  
  public class CouponHolder extends RecyclerView.ViewHolder {
  
  final ViewDataBinding binding;
  //private final CouponItemBinding binding;
  
  public CouponHolder(CouponItemBinding binding) {
      super(binding.getRoot());
      this.binding = binding;
  }
  
  public void bind(Object obj) {
      binding.setVariable(BR.data, obj);
      binding.executePendingBindings();
  }
  }
  </code></pre>
  
  <p>And finally, here is the adapter I made for my Coupon Item:</p>
  
  <pre><code>package com.example.mmcke.campuscoupons.model;
  
  import android.content.Context;
  import android.databinding.DataBindingUtil;
  import android.databinding.ViewDataBinding;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.example.mmcke.campuscoupons.BR;
  import com.example.mmcke.campuscoupons.R;
  import com.example.mmcke.campuscoupons.databinding.ActivityMainBinding;
  import com.example.mmcke.campuscoupons.databinding.CouponItemBinding;
  
  import java.util.ArrayList;
  
  /**
   *
   * A class to help with displaying coupons
   * Created by mmcke on 11/21/2018.
   */
  
  public class CouponAdapter extends RecyclerView.Adapter&lt;CouponHolder&gt;{
  
  private Context context;
  private ArrayList&lt;Coupon&gt; coupons;
  
  public CouponAdapter(Context _context, ArrayList&lt;Coupon&gt; _coupons) {
      this.context = _context;
      this.coupons = _coupons;
  }
  
  @Override
  public int getItemCount() {
      return coupons.size();
  }
  
  @Override
  public CouponHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
      CouponItemBinding binding = DataBindingUtil.inflate(layoutInflater, R.layout.coupon_item, parent, false);
      return new CouponHolder(binding);
  }
  
  @Override
  public void onBindViewHolder(CouponHolder holder, int position) {
      Coupon data = coupons.get(position);
      holder.binding.setVariable(BR.data, data);
  }
  
  }
  </code></pre>
  
  <p>Any and all help is appreciated.</p>