Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing CardView and RecyclerView (Android 5.0) in my existing project (eclipse)

Tags:

I want to import CardView and RecyclerView in my existing project. I am using ECLIPSE. I read other answers in stackoverflow but all of them are for Android Studio. ve Can anyone please help me ?

The error I am receiving is : CardView cannot be resolved to a type.

Update: Commonwares answer helped me solve this. But now I have another error. (Error inflating class and android.support.v7.widget.CardView). Please someone help me.

like image 487
Harsh Pokharna Avatar asked Oct 21 '14 17:10

Harsh Pokharna


3 Answers

They are also available as Android library projects now, in extras/android/support/v7/ of your SDK installation. Make a copy of those projects elsewhere on your hard drive, import them into Eclipse, then reference them as libraries from your app following the instructions in the documentation.

like image 112
CommonsWare Avatar answered Oct 20 '22 01:10

CommonsWare


Currently to get the recyclerView you first download from the sdk manager the Android support repository in the 'Extras" section. After that you need to import all the libraries from here (starting from your sdk folder path):

sdk\extras\android\m2repository\com\android\support

enter image description here

like image 45
j2emanue Avatar answered Oct 20 '22 01:10

j2emanue


adding android-support-v7-recyclerview.jarfrom the folder: sdk\extras\android\support\v7\recyclerview\libs to the libs resolved my problem.

like image 34
Blue_Alien Avatar answered Oct 19 '22 23:10

Blue_Alien