Card_view material design

前端 未结 5 652
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 01:33

I am trying to use card_view. But it keeps giving an error.

Error:(13) No resource identifier found for attribute `\'cardCornerRadius\' in pa

相关标签:
5条回答
  • 2021-02-05 02:22

    EDIT: This has been fixed in the Android 5.0 Lollipop SDK. Simply add

    compile 'com.android.support:cardview-v7:21.+'
    

    to your build.gradle and you're good to go.

    OLD answer:

    You'll need to add the cardview support library dependency to build.gradle:

    compile 'com.android.support:cardview-v7:21.+'
    

    However, due to the way Google built the library, you'll also have to compile your app using the latest "L" SDK:

    compileSdkVersion "android-L"
    buildToolsVersion "20.0.0"
    

    and

    minSdkVersion 14
    targetSdkVersion "L"
    

    Note that the minSdkVersion here doesn't really matter - as long as you compile with "L" SDK, your app can only run on L device/emulator no matter what minSdkVersion is specified.

    The only viable way to build with the cardview lib for earlier Android version seems to be using Eddie Ringle's workaround.

    See Failure [INSTALL_FAILED_OLDER_SDK] Android-L for some related info.

    0 讨论(0)
  • 2021-02-05 02:27

    I just resolved this problem by checking CardView project "Library Module" in Android Studio.

    0 讨论(0)
  • 2021-02-05 02:27

    For those of you coming in here looking for Xamarin-specific, once you've added the Android Support Library v7 CardView component, you need to Clean your project and then re-build.

    0 讨论(0)
  • 2021-02-05 02:34

    For eclipse We need to include both the things add android.support.v7.widget.CardView as a library project and also add + check it's jar file in java build path

    • Go to File -> Import -> Existing Android code into workspace --> Browse (Go to sdk/extras/android/support/v7/cardview) --> Click ok --> Click Finish
    • Right click on cardview project --> Properties --> Android(Left Pane) --> Enable isLibrary (tick the checkbox) --> Apply --> ok
    • Right click on your project --> Properties --> Android(Left pane) --> Add (under library) --> cardview --> apply --> ok
    • Right click on your project again --> build path --> configure build path -->under libraries-->add jar-->expand cardview-->expand libs-->select android.support.v7.widget.CardView.jar

    under order and export-->check android.support.v7.widget.CardView.jar-->click

    Hope it will help someone.

    0 讨论(0)
  • 2021-02-05 02:37

    Please add this line compile 'com.android.support:cardview-v7:23.1.1' in build.gradle file under dependencies.

    Please visit this link for the latest changes has made for any dependencies.

    0 讨论(0)
提交回复
热议问题