gpt4 book ai didi

安卓.view.InflateException : Binary XML file line #1: Error inflating class

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:02:47 25 4
gpt4 key购买 nike

在我的项目中添加了ActionBarCompat + NavDrawer,在4.3设备上运行很流畅,在2.3设备上我得到以下异常:

09-08 15:09:15.229: E/AndroidRuntime(2964): FATAL EXCEPTION: main
09-08 15:09:15.229: E/AndroidRuntime(2964): android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
09-08 15:09:15.229: E/AndroidRuntime(2964): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.AbsListView.obtainView(AbsListView.java:1582)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.ListView.makeAndAddView(ListView.java:1801)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.ListView.fillDown(ListView.java:724)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.ListView.fillFromTop(ListView.java:781)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.ListView.layoutChildren(ListView.java:1652)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.AbsListView.onLayout(AbsListView.java:1412)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.View.layout(View.java:7175)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:702)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.View.layout(View.java:7175)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.View.layout(View.java:7175)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.View.layout(View.java:7175)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.View.layout(View.java:7175)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.View.layout(View.java:7175)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.ViewRoot.performTraversals(ViewRoot.java:1146)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.ViewRoot.handleMessage(ViewRoot.java:1866)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.os.Handler.dispatchMessage(Handler.java:99)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.os.Looper.loop(Looper.java:130)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.app.ActivityThread.main(ActivityThread.java:3687)
09-08 15:09:15.229: E/AndroidRuntime(2964): at java.lang.reflect.Method.invokeNative(Native Method)
09-08 15:09:15.229: E/AndroidRuntime(2964): at java.lang.reflect.Method.invoke(Method.java:507)
09-08 15:09:15.229: E/AndroidRuntime(2964): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
09-08 15:09:15.229: E/AndroidRuntime(2964): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
09-08 15:09:15.229: E/AndroidRuntime(2964): at dalvik.system.NativeStart.main(Native Method)
09-08 15:09:15.229: E/AndroidRuntime(2964): Caused by: java.lang.reflect.InvocationTargetException
09-08 15:09:15.229: E/AndroidRuntime(2964): at java.lang.reflect.Constructor.constructNative(Native Method)
09-08 15:09:15.229: E/AndroidRuntime(2964): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
09-08 15:09:15.229: E/AndroidRuntime(2964): ... 35 more
09-08 15:09:15.229: E/AndroidRuntime(2964): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x10102fd a=-1}
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.content.res.Resources.loadDrawable(Resources.java:1681)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.view.View.<init>(View.java:1951)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.TextView.<init>(TextView.java:389)
09-08 15:09:15.229: E/AndroidRuntime(2964): at android.widget.TextView.<init>(TextView.java:382)
09-08 15:09:15.229: E/AndroidRuntime(2964): ... 38 more

我已经根据手册使用正确的支持包等设置了一切......

有什么想法吗?如何确定罪魁祸首 xml 文件?

最佳答案

然后将 ActionBarCompat 添加到 google 的 Navigation Drawer 示例中,不要忘记将 native 方法更改为 SupportMethods:getActionBar() -> getSupportActionBar(); invalidateOptionsMenu() -> supportInvalidateOptionsMenu(); ...

并从 drawer_list_item.xml 和其他仅适用于 API 14+ 的属性 "?android:attr/..." 中删除

great tutorial by Gabriele Mariotti必须帮助你。

关于安卓.view.InflateException : Binary XML file line #1: Error inflating class <unknown>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18685278/

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