无法理解logcat

时间:2014-10-30 16:21:52

标签: java android logcat

10-29 05:13:29.240: I/dalvikvm(1516): Could not find method android.view.ViewGroup.onNestedScrollAccepted, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onNestedScrollAccepted
10-29 05:13:29.240: W/dalvikvm(1516): VFY: unable to resolve virtual method 11379: Landroid/view/ViewGroup;.onNestedScrollAccepted (Landroid/view/View;Landroid/view/View;I)V
10-29 05:13:29.260: D/dalvikvm(1516): VFY: replacing opcode 0x6f at 0x0000
10-29 05:13:29.260: I/dalvikvm(1516): Could not find method android.view.ViewGroup.onStopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onStopNestedScroll
10-29 05:13:29.260: W/dalvikvm(1516): VFY: unable to resolve virtual method 11385: Landroid/view/ViewGroup;.onStopNestedScroll (Landroid/view/View;)V
10-29 05:13:29.260: D/dalvikvm(1516): VFY: replacing opcode 0x6f at 0x0000
10-29 05:13:29.260: I/dalvikvm(1516): Could not find method android.support.v7.internal.widget.ActionBarOverlayLayout.stopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.setHideOnContentScrollEnabled
10-29 05:13:29.260: W/dalvikvm(1516): VFY: unable to resolve virtual method 8958: Landroid/support/v7/internal/widget/ActionBarOverlayLayout;.stopNestedScroll ()V
10-29 05:13:29.260: D/dalvikvm(1516): VFY: replacing opcode 0x6e at 0x000e
10-29 05:13:29.290: I/dalvikvm(1516): Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
10-29 05:13:29.290: W/dalvikvm(1516): VFY: unable to resolve virtual method 365: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
10-29 05:13:29.300: D/dalvikvm(1516): VFY: replacing opcode 0x6e at 0x0002
10-29 05:13:29.300: I/dalvikvm(1516): Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
10-29 05:13:29.300: W/dalvikvm(1516): VFY: unable to resolve virtual method 387: Landroid/content/res/TypedArray;.getType (I)I
10-29 05:13:29.300: D/dalvikvm(1516): VFY: replacing opcode 0x6e at 0x0002
10-29 05:13:29.420: D/AndroidRuntime(1516): Shutting down VM
10-29 05:13:29.420: W/dalvikvm(1516): threadid=1: thread exiting with uncaught exception (group=0xb1a4cd70)
10-29 05:13:29.450: E/AndroidRuntime(1516): FATAL EXCEPTION: main
10-29 05:13:29.450: E/AndroidRuntime(1516): Process: com.example.foodorder, PID: 1516
10-29 05:13:29.450: E/AndroidRuntime(1516): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.foodorder/com.example.foodorder.MainActivity}: android.view.InflateException: Binary XML file line #22: Error inflating class android.widget.ImageButton
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.ActivityThread.access$800(ActivityThread.java:138)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.os.Handler.dispatchMessage(Handler.java:102)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.os.Looper.loop(Looper.java:136)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.ActivityThread.main(ActivityThread.java:5026)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at java.lang.reflect.Method.invokeNative(Native Method)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at java.lang.reflect.Method.invoke(Method.java:515)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at dalvik.system.NativeStart.main(Native Method)
10-29 05:13:29.450: E/AndroidRuntime(1516): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class android.widget.ImageButton
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.createView(LayoutInflater.java:620)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:57)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at com.example.foodorder.MainActivity.onCreate(MainActivity.java:17)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.Activity.performCreate(Activity.java:5242)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
10-29 05:13:29.450: E/AndroidRuntime(1516):     ... 11 more
10-29 05:13:29.450: E/AndroidRuntime(1516): Caused by: java.lang.reflect.InvocationTargetException
10-29 05:13:29.450: E/AndroidRuntime(1516):     at java.lang.reflect.Constructor.constructNative(Native Method)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.LayoutInflater.createView(LayoutInflater.java:594)
10-29 05:13:29.450: E/AndroidRuntime(1516):     ... 24 more
10-29 05:13:29.450: E/AndroidRuntime(1516): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x5/d=0x1001 a=2 r=0x7f08002b}
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.content.res.Resources.loadDrawable(Resources.java:2073)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.view.View.<init>(View.java:3566)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.widget.ImageView.<init>(ImageView.java:123)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.widget.ImageButton.<init>(ImageButton.java:87)
10-29 05:13:29.450: E/AndroidRuntime(1516):     at android.widget.ImageButton.<init>(ImageButton.java:83)
10-29 05:13:29.450: E/AndroidRuntime(1516):     ... 27 more

有人可以向我解释如何解决运行时错误?

2 个答案:

答案 0 :(得分:4)

setContentView() MainActivity.onCreate(MainActivity.java:17)中的ImageButton虚张声势的布局文件在第22行(​​Binary XML file line #22)上有一个Drawable,它的属性需要Drawable但是该值不是Resource is not a Drawable (color or path)android:background)。可能它是View,因为它由View.<init>构造函数(Drawable)处理。

这些错误通常是由于不支持的样式引用代替dimen而引起的。

特别是,读取的资源值是TypedValue资源({{1}}类型5),而不是可绘制的。

答案 1 :(得分:0)

  

引起:android.view.InflateException:二进制XML文件行#22

     

引起:android.content.res.Resources $ NotFoundException:资源不是Drawable

检查你的xml文件,尝试清理并重建项目