title: Didn't find class "android.support.v7.widget.RecyclerView
body: <p>I'm getting this  exception when running:  </p>
  
  <p>android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.RecyclerView<br>
  <strong>Caused by: java.lang.ClassNotFoundException: 
   Didn't find class "android.support.v7.widget.RecyclerView" on path: /data/app/my.package.location-1.apk</strong></p>
  
  <p>There are some questions concerning this error, from which I've learned to:<br>
  - specify exactly the <code>support.v7</code> RecyclerView, in the xml and Java code.<br>
  - in Eclipse, I added this jar file as a library to the project:<br>
  <em>adt-bundle-windows-x86_64-20140321\sdk\extras\android\support\v7\recyclerview\libs\android-support-v7-recyclerview.jar</em><br>
  - in Eclipse, import the existing project TestActivity in  *adt-bundle-windows-x86_64-20140321\sdk\extras\android\support\v7\recyclerview*
  and then added that project to the Java Build Path of my own project.  </p>
  
  <p>Project Build Target is Android 5.1.1/API 22</p>
  
  <p>All to no effect.
  What else is there?</p>
  
  <p>from MyFragment.java</p>
  
  <pre><code>import android.support.v7.widget.RecyclerView;
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
              final Activity thisActivity = getActivity();
              final RecyclerView recyclerView = (RecyclerView)thisActivity.findViewById(R.id.my_listview);
  
              final List&lt;String&gt; list = Arrays.asList(HEADERS);
  
              final MyRecyclerAdapter adapter = new MyRecyclerAdapter(list);
              recyclerView.setAdapter(adapter);
  
  }
  </code></pre>
  
  <p>MyRecyclerAdapter.java</p>
  
  <pre><code>import android.support.v7.widget.RecyclerView;
  
      public class MyRecyclerAdapter extends RecyclerView.Adapter&lt;MyRecyclerAdapter.ViewHolder&gt; {
        private ArrayList&lt;String&gt; mDataset;
  
        // Provide a suitable constructor (depends on the kind of dataset)
        public MyRecyclerAdapter(List&lt;String&gt; list) {
          mDataset = (ArrayList&lt;String&gt;) list;
        }
  
        // Create new views (invoked by the layout manager)
        @Override
        public MyRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
            // create a new view
          View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_layout, parent, false);
          // set the view's size, margins, paddings and layout parameters
          ViewHolder vh = new ViewHolder(v);
          return vh;
        }
  
        // Replace the contents of a view (invoked by the layout manager)
        @Override
        public void onBindViewHolder(ViewHolder holder, int position) {
          // - get element from your dataset at this position
          // - replace the contents of the view with that element
          final String name = mDataset.get(position);
          holder.txtId.setText(mDataset.get(position));
          holder.txtId.setOnClickListener(new OnClickListener() {
                  @Override
                  public void onClick(View v) {
                    remove(name);
                  }
              });
  
          holder.txtType.setText("Footer: " + mDataset.get(position));
  
        }
  
        // Return the size of your dataset (invoked by the layout manager)
        @Override
        public int getItemCount() {
          return mDataset.size();
        }
        // Provide a reference to the views for each data item
        // Complex data items may need more than one view per item, and
        // you provide access to all the views for a data item in a view holder
  
        public class ViewHolder extends RecyclerView.ViewHolder {
          // each data item is just a string in this case
          public TextView txtId;
          public TextView txtType;
          public TextView txtName;
  
          public ViewHolder(View v) {
            super(v);
            txtId = (TextView) v.findViewById(R.id.id);
            txtType = (TextView) v.findViewById(R.id.type);
            txtName = (TextView) v.findViewById(R.id.name); 
           }
        }
  
        public void add(int position, String item) {
          mDataset.add(position, item);
          notifyItemInserted(position);
        }
  
        public void remove(String item) {
          int position = mDataset.indexOf(item);
          mDataset.remove(position);
          notifyItemRemoved(position);
        }
  
      } 
  </code></pre>
  
  <p>fragment.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"
      android:background="#000000" &gt;
  
  &lt;android.support.v7.widget.RecyclerView
      android:id="@+id/my_listview"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" /&gt; 
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>row_layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="horizontal"&gt;
  
      &lt;TextView
          android:id="@+id/id"
          android:textColor="#FFFFFF"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textSize="30sp" &gt;
      &lt;/TextView&gt;
  
      &lt;TextView
          android:id="@+id/type"
          android:textColor="#FFFFFF"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textSize="30sp" &gt;
      &lt;/TextView&gt;
  
      &lt;TextView
          android:id="@+id/name"
          android:textColor="#FFFFFF"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textSize="30sp" &gt;
      &lt;/TextView&gt;
  
  &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p>Edit: As suggested by Arman Kabir, I checked "Is Library". This does indeed fix the <code>ClassNotFoundException</code>. It does result in a slightly different error, but this is another problem.</p>
  
  <pre><code>android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.RecyclerView
      at android.view.LayoutInflater.createView(LayoutInflater.java:613)
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
  lang.reflect.InvocationTargetException
      at java.lang.reflect.Constructor.constructNative(Native Method)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
      at android.view.LayoutInflater.createView(LayoutInflater.java:587)
      ... 44 more
  Caused by: java.lang.NoClassDefFoundError: android.support.v4.util.Pools$SimplePool
      at android.support.v7.widget.AdapterHelper.&lt;init&gt;(AdapterHelper.java:56)
      at android.support.v7.widget.AdapterHelper.&lt;init&gt;(AdapterHelper.java:71)
      at android.support.v7.widget.RecyclerView.initAdapterManager(RecyclerView.java:455)
      at android.support.v7.widget.RecyclerView.&lt;init&gt;(RecyclerView.java:339)
      ... 47 more
  </code></pre>