android.view.InflateException:二进制XML文件行#6:二进制XML文件行#8:错误膨胀类android.support.v7.widget.RecyclerView

时间:2016-12-25 05:51:25

标签: java android

为什么会发生这种错误?

  

android.view.InflateException:二进制XML文件行#6:二进制XML文件行#8:错误膨胀类android.support.v7.widget.RecyclerView                                                                                在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)                                                                                在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2729)                                                                                在android.app.ActivityThread.-wrap12(ActivityThread.java)                                                                                在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1576)                                                                                在android.os.Handler.dispatchMessage(Handler.java:111)                                                                                在android.os.Looper.loop(Looper.java:207)                                                                                在android.app.ActivityThread.main(ActivityThread.java:5931)                                                                                at java.lang.reflect.Method.invoke(Native Method)                                                                                在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:888)                                                                                在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)

的xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/main_background"
>
<android.support.v7.widget.RecyclerView
    android:id="@+id/history"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="28dp"
    android:layout_marginBottom="17dp"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    android:layout_alignParentBottom="true"

    android:scrollbars="none"
    android:fadingEdge="none"
    android:overScrollMode="never"

   />

的build.gradle:

apply plugin: 'com.android.application'

android {
  compileSdkVersion 23
  buildToolsVersion "24.0.2"

  defaultConfig {
    applicationId "com.android.calculator3"
  }

  buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
  }
}

dependencies {
  compile files('libs/android-support-v7-recyclerview.jar')
  compile files('libs/arity-2.1.2.jar')
}

0 个答案:

没有答案