CardView for android not importing
Asked Answered
S

2

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'
Sinegold answered 16/7, 2014 at 7:34 Comment(1)
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.jarJohnniejohnny
J
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

Johnniejohnny answered 20/8, 2014 at 19:56 Comment(2)
@HarshaVardhan there is no more project on my github for this answer as it is no longer relevant. Please see my update if you want to use CardviewJohnniejohnny
but i think design library automatically providing thisLipinski
B
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/

Butts answered 3/1, 2015 at 7:1 Comment(3)
I am using eclipse. Do you have the link for library file of Recycler List / Card List.Sinegold
which eclipse you are using??Butts
I am using eclipse keplerSinegold

© 2022 - 2024 — McMap. All rights reserved.