-1

So I found this library: CardsLib which is a very modern and cool interface to implement in android and I followed his instruction given here to add the library to my project. However my main project has a build target API of Android 5.0 (21) and the Cardslib Library has a target of Android 4.0 (14) and when added to my project leaves me a nasty list of errors which are as follows:

G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:23: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.
    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values-v16\styles.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.
    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values-v16\styles.xml:23: error: Error: No resource found that matches the given name: attr 'android:fontFamily'.
     G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'card.native.content_outer_layout'.
    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:48: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.
    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.

    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:64: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.

    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:23: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.

    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values-v16\styles.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.

    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'card.native.content_outer_layout'.

    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:48: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.

    G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.
     G:\UI Kit\Android Sample Projects\cardslib-master\cardslib-master\library-cards\src\main\res\values\styles.xml:64: error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.

I tried changing the Build target of the library to Android 5.0 but that didn't help. What do yall suggest please?

Pjayness
  • 365
  • 1
  • 6
  • 22
  • none of those errors suggest anything related to the target API, they all suggest you are missing resources from the library – tyczj Dec 23 '14 at 16:47
  • I guess you could ask the maker of the library on how to integrate it to your app. Doesn't look like it has anything to do with the Target API setting. – Ridcully Dec 23 '14 at 16:49
  • @tyczj Hmm okay. I just thought that could be the reason since these errors are thrown when I add the library to the project – Pjayness Dec 23 '14 at 16:51

1 Answers1

0

First of all,you can check all info about target, minSdk and api used to compile here:

https://github.com/gabrielemariotti/cardslib/blob/master/library-core/build.gradle

  • The target of the library is 21 (and not 14)
  • The minSdk is 14
  • The api needed to compile is 21

Now, it is quite difficult to say what is your issue, but this error

No resource found that matches the given name: attr 'android:fontFamily'

sounds like you are using an API<16 to compile your project.

The second advice is to use Android Studio (now it is the official IDE) to work with Android in general and with this library.

Just add this line to your dependencies

dependencies {

    //Core card library
    compile 'com.github.gabrielemariotti.cards:cardslib-core:2.0.1'
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • Apologies for causing trouble over your brilliant library sir :) I still couldn't get it to work, pardon me. My library is set to the default min and target as you set before distributing and my project is set at min 14 and target 18. It should work yeah? It's still throwing those errors I mentioned in the question. I added that dependency to the library's gradle as well. Even without adding the library as a reference to my project, the library itself is marked with those errors and hence I can't build the library either. What could be causing this issue? – Pjayness Jan 01 '15 at 16:05
  • The v2 requires the api 21 to compile the project. – Gabriele Mariotti Jan 01 '15 at 16:08