Didn't find class "android.support.v7.widget.RecyclerView

后端 未结 6 510
走了就别回头了
走了就别回头了 2021-01-07 23:45

I\'m getting this exception when running:

android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.RecyclerView

6条回答
  •  醉酒成梦
    2021-01-08 00:36

    This is my eclipse journey to complete my mqtt project.

    First of all, you have to check if the support library exists, if not you have to download it using sdk manager.

    I know you've already got that library. Just check the directory where the support library is. You are sure to confirm there are four directories existed on the picture.

    In your case, you will have two core libraries both appcompat-v7 and support-v4 that are all version 22 or higher at least.

    There must be a aar file in each folders. you have to change the suffix aar to zip, then unzip it under the folder. Rename both classes.jar to appcompat-v7-22.1.0.jar and support-v4-22.1.0.jar.

    It means that you are ready to copy them to the proper libs folder in your project.

    you do the same action with both folders.

    In the recyclerview-v7\21.0.0 folder, you can juse rename the classes.jar to whatever name you want and the support-annotations-21.0.0.jar under the support-annotations\21.0.0\ then copy them to the your libs folder of your project.

    Import existing android projects to your eclipse,

    Also, do the same thing with the support-v4-22.1.0 library.

    Don't forget check the checkbox - 'Is Library'

    You can finally set up all configuration for your project like picture as follows.

    This is my project.properties file.

    target=android-21
    
    java.target=1.7
    java.source=1.7
    
    android.library.reference.1=..\\MqttService
    android.library.reference.2=..\\extras\\android\\m2repository\\com\\android\\support\\appcompat-v7\\22.1.0\\appcompat-v7-22.1.0
    android.library.reference.3=..\\extras\\android\\m2repository\\com\\android\\support\\support-v4\\22.1.0\\support-v4-22.1.0
    

提交回复
热议问题