Exception : android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.CardView

前端 未结 7 981
长情又很酷
长情又很酷 2020-12-16 23:54

I am using CardView of support library in my android app. I tried 4-5 hours to resolve this but i could not get success.

I have added CardView

7条回答
  •  萌比男神i
    2020-12-17 00:44

    I had the same problem as you.

    In Eclipse, when you import cardview from directory \sdk\extras\android\support\v7\cardview follow the steps that are commented in "Adding libraries with resources -> Eclipse" in the official documentation: https://developer.android.com/intl/es/tools/support-library/setup.html#libs-with-res

    Before adding cardview as library to your project, go to "Properties -> Android" of cardview project and add the android-support-v7-appcompat library. Don't forget check "IsLibrary".

    Now, you can add cardview as library to your project. Clean both projects to refresh the changes.

    I hope it helps you.

提交回复
热议问题