8

I got the jar file of Card View from

sdk\extras\android\m2repository\com\android\support\cardview-v7\21.0.0-rc1

and I tried the example from this link1 and link2

I was able to do for Recycler but for card view it is shwoing the error in xml for importing android.support.v7.widget.CardView in XML layout

and the detailed error is

error: No resource identifier found for attribute 'cardCornerRadius' in package 'com.cards.cardlayoutui'
Kartheek Sarabu
  • 3,886
  • 8
  • 33
  • 66
  • to elaborate more on this issue, you don't have that resource by just adding the classes.jar file. Your best bet is to either import my library below, and add the classes.jar file to that as a dependency or manually create what i have on github then add the dependency for the classes.jar – kandroidj Aug 21 '14 at 12:36

2 Answers2

0

Please see my post on GitHub: https://github.com/lt-tibs1984/CardViewLibrary This should walk you through how to take this project, and use the downloaded SDK for CardView. I will be updating this tonight as I Can.

Basically, the problem is that when you unpack the zip file and import only the jar file you have no resources associated to the card view.

Just download my zip file, import that as existing code into a workspace, then add the classes.jar as the libraries dependency!

Directions available in the read me

Update

The original project for this answer neither still relevant nor still exists.

To use Cardview in your project,

Add

implementation 'com.android.support:cardview-v7:28.0.0'

or if using androidx:

implementation 'androidx.cardview:cardview:1.0.0'

to your app's build.gradle

kandroidj
  • 13,784
  • 5
  • 64
  • 76
0

try to add values xml file and follow this tutorial may be it will help

http://treyrobinson.net/blog/android-l-tutorials-part-3-recyclerview-and-cardview/

Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96