N'ai pas trouver la classe "android.de soutien.v7.widget de.RecyclerView

Je suis de cette exception lors de l'exécution:

android.vue.InflateException: Binaire dans le fichier XML de la ligne n ° 8: Erreur de gonflage de la classe android.de soutien.v7.widget de.RecyclerView

Causés par: java.lang.ClassNotFoundException:
N'ai pas trouver la classe "android.de soutien.v7.widget de.RecyclerView" sur le chemin: /data/app/ma.package.localisation-1.apk

Il y a quelques questions au sujet de cette erreur, à partir de laquelle j'ai appris à:

- préciser exactement le support.v7 RecyclerView, dans le fichier xml et le code Java.

- dans Eclipse, j'ai ajouté ce fichier jar d'une bibliothèque pour le projet:

adt-bundle-windows-x86_64-20140321\sdk\extras\android\support\v7\recyclerview\libs\android-support-v7-recyclerview.jar

- dans Eclipse, importer un projet existant TestActivity *adt-bundle-windows-x86_64-20140321\sdk\extras\android\support\v7\recyclerview*
et ensuite ajouté que le projet de la Java Build Path de mon propre projet.

Projet de construction de la Cible est Android 5.1.1/API 22

Tous à aucun effet.
Quoi d'autre est là?

de MyFragment.java

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<String> list = Arrays.asList(HEADERS);

            final MyRecyclerAdapter adapter = new MyRecyclerAdapter(list);
            recyclerView.setAdapter(adapter);

}

MyRecyclerAdapter.java

import android.support.v7.widget.RecyclerView;
public class MyRecyclerAdapter extends RecyclerView.Adapter<MyRecyclerAdapter.ViewHolder> {
private ArrayList<String> mDataset;
//Provide a suitable constructor (depends on the kind of dataset)
public MyRecyclerAdapter(List<String> list) {
mDataset = (ArrayList<String>) 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);
}
} 

fragment.xml

<?xml version="1.0" encoding="utf-8"?>
<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" >
<android.support.v7.widget.RecyclerView
android:id="@+id/my_listview"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> 
</RelativeLayout>

row_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/id"
android:textColor="#FFFFFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp" >
</TextView>
<TextView
android:id="@+id/type"
android:textColor="#FFFFFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp" >
</TextView>
<TextView
android:id="@+id/name"
android:textColor="#FFFFFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp" >
</TextView>
</LinearLayout> 

Edit: Comme suggéré par Arman Kabir, j'ai coché "Est la Bibliothèque". Ce n'est en effet fixer le ClassNotFoundException. C'est un peu différente de l'erreur, mais c'est un autre problème.

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.<init>(AdapterHelper.java:56)
at android.support.v7.widget.AdapterHelper.<init>(AdapterHelper.java:71)
at android.support.v7.widget.RecyclerView.initAdapterManager(RecyclerView.java:455)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:339)
... 47 more
Passer à Android Studio.
Comment est-ce à résoudre le problème?

OriginalL'auteur Al Lelopath | 2015-04-17