Error inflating class RecyclerView

后端 未结 5 1440
野性不改
野性不改 2020-12-17 08:57

So my code simply makes a list of CardViews using RecyclerView. Upon running my code i kept getting a weird error claiming there was an error in my xml. After tinkering for

5条回答
  •  囚心锁ツ
    2020-12-17 09:09

    I meet this problem today. And solved it.

    first step:keep the support-libs you used are same version

    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    

    second step:you should add recyclerView to your proguard files

    -keep class android.support.v7.widget.** {*;}
    // I`ve just keep all widgets
    

提交回复
热议问题