Error inflating class and android.support.v7.widget.CardView

后端 未结 15 1597
-上瘾入骨i
-上瘾入骨i 2020-11-27 20:47

I want to use CardView in my project, but when I run my application, I get the following error. I\'m using Eclipse.

Error: Error inflating clas         


        
15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 21:35

    if you are using intellij use these steps, this actually works

    • click in your project,
    • right click -> open Module Settings (f4)
    • import cardview from \sdk\extras\android\support\v7\
    • add .jar file to cardview module
    • click on your project and give module dependency to cardview
    • now, click (+) button on cardview -> android -> at top you will see a check box (library module), enable it.
    • click ok and close your settings dialog.
    • rebuild your project and run it.

提交回复
热议问题