Error inflating class RecyclerView

后端 未结 5 1477
野性不改
野性不改 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

    Make sure to include before you add RecyclerView to your XML

    compile 'com.android.support:recyclerview-v7:22.2.0'
    compile 'com.android.support:appcompat-v7:22.2.0'
    

    If you created RecyclerView in your XML before adding these dependencies, to make it work you should remove (comment) your recycler view, build project without it and then add it back. Otherwise it still shows Inflate exception in binary XML line #n.

提交回复
热议问题