gpt4 book ai didi

Android 设计库 23.1.0 NavigationView

转载 作者:搜寻专家 更新时间:2023-11-01 08:40:19 25 4
gpt4 key购买 nike

我在使用设计库 23.1.0 时遇到问题

我尝试将设计库从 23.0.1 更新到 23.1.0,但现在我的应用程序在尝试膨胀我的 navigationView 时崩溃了。

如果我没记错的话,这两个版本之间的 navigationView 应该没有任何重大变化。

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

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

崩溃发生在我的 Activity on 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

更新:

显然这是混淆器的问题。

我还没有找到需要什么规则。

最佳答案

所以我找到了解决方案。

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

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

注意:我没有收到任何来自混淆器的警告来指出这个问题。

关于Android 设计库 23.1.0 NavigationView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33322231/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com