Android设计库23.1.0 NavigationView

时间:2015-10-24 19:11:43

标签: android android-design-library android-navigationview

我遇到设计库23.1.0的问题

我尝试将设计库从23.0.1更新到23.1.0, 但是现在我的应用程序在尝试给我的导航视图充气时崩溃了。

如果我没弄错的话,这两个版本之间的导航视图不应该有任何重大变化。

我尝试将我的代码与cheesesquare项目进行比较(https://github.com/chrisbanes/cheesesquare) 但我找不到任何真正的差异。

如果需要更多信息,我会提供。

崩溃发生在我setContentView(R.layout.myLayout)

上的活动中

我的XML就像这样

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <include layout="@layout/toolbar" />

        <FrameLayout
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </LinearLayout>

    <android.support.design.widget.NavigationView
        android:id="@+id/navigation"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/navigation_header"
        app:menu="@menu/navigation_items" />

</android.support.v4.widget.DrawerLayout>

崩溃日志很长并且没有完成:

    10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime: FATAL EXCEPTION: main
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime: Process: be.myApp, PID: 10085
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{be.myApp/be.myApp.home.SyndicHomeActivity}: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class android.support.design.widget.NavigationView
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:  Caused by: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class android.support.design.widget.NavigationView
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at be.myApp.home.SyndicHomeActivity.onCreate(SyndicHomeActivity.java:39)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:  Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class android.support.design.widget.NavigationView
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:645)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at be.myApp.home.SyndicHomeActivity.onCreate(SyndicHomeActivity.java:39) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:  Caused by: java.lang.reflect.InvocationTargetException
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Native Method)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:619)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at be.myApp.home.SyndicHomeActivity.onCreate(SyndicHomeActivity.java:39) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:  Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.design.internal.NavigationMenuView
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.internal.NavigationMenuPresenter.getMenuView(NavigationMenuPresenter.java:97)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.widget.NavigationView.<init>(NavigationView.java:165)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.widget.NavigationView.<init>(NavigationView.java:94)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at be.myApp.home.SyndicHomeActivity.onCreate(SyndicHomeActivity.java:39) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:  Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class android.support.design.internal.NavigationMenuView
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:645)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.internal.NavigationMenuPresenter.getMenuView(NavigationMenuPresenter.java:97) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.widget.NavigationView.<init>(NavigationView.java:165) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.widget.NavigationView.<init>(NavigationView.java:94) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at be.myApp.home.SyndicHomeActivity.onCreate(SyndicHomeActivity.java:39) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:  Caused by: java.lang.reflect.InvocationTargetException
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Native Method)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:619)
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.internal.NavigationMenuPresenter.getMenuView(NavigationMenuPresenter.java:97) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.widget.NavigationView.<init>(NavigationView.java:165) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.design.widget.NavigationView.<init>(NavigationView.java:94) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at be.myApp.home.SyndicHomeActivity.onCreate(SyndicHomeActivity.java:39) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:  Caused by: java.lang.IllegalStateException: Binary XML file line #17: Error creating LayoutManager android.support.v7.widget.LinearLayoutManager
10-24 20:57:47.314 10085-10085/be.myApp E/AndroidRuntime:   at android.support.v7.widget.RecyclerView.createLayoutMan

更新

显然这与proguard存在问题。

我还没有找到需要的规则。

1 个答案:

答案 0 :(得分:3)

所以我找到了解决方案。

我必须将以下规则添加到我的proguard文件中:

-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }

注意:我没有收到来自proguard的任何警告,表明存在此问题。