Logcat仅打印部分运行时错误

时间:2016-04-06 19:45:12

标签: android

所以我一直在用xml捣乱,今天我遇到了一个只打印了一半的错误。这是日志:

04-06 14:25:20.201 32581 32581 E AndroidRuntime: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class <unknown>
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:378)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.ArrayAdapter.getView(ArrayAdapter.java:369)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at com.kik.view.adapters.ba.getView(SourceFile:324)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.AbsListView.obtainView(AbsListView.java:2346)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.ListView.measureHeightOfChildren(ListView.java:1281)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.ListView.onMeasure(ListView.java:1188)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.View.measure(View.java:18797)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.View.measure(View.java:18797)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.View.measure(View.java:18797)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.View.measure(View.java:18797)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.View.measure(View.java:18797)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2899)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.View.measure(View.java:18797)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.Choreographer.doCallbacks(Choreographer.java:670)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.Choreographer.doFrame(Choreographer.java:606)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5466)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-06 14:25:20.201 32581 32581 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.LayoutInflater.createView(LayoutInflater.java:645)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        ... 45 more
04-06 14:25:20.201 32581 32581 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at java.lang.reflect.Constructor.newInstance(Native Method)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        at android.view.LayoutInflater.createView(LayoutInflater.java:619)
04-06 14:25:20.201 32581 32581 E AndroidRuntime:        ... 48 more
04-06 14:25:20.201 32581 32581 E AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: Failed to r

我担心我无法提供更多代码,因为我并不完全确定我的哪个xml有问题。

每当我崩溃它,无论如何,它只打印&#34;失败r&#34;然后继续记录其他错误,这阻止我看到它可能无法找到的资源的实际ID,并阻止我弄清楚哪个xml给了我悲伤。 我不太担心错误本身;我更关心logcat让我失望的事实。 有没有人在这里遇到过这个?有没有人知道任何变通办法?

万分感谢 〜n的

编辑:我已经标记了wpgbrown的答案是正确的,因为它似乎是问题的根源,但是对于任何未来遇到这种情况的可怜的灵魂来说:你&#39; ll可能要改变&#34;条目&#34;缓冲区大小,每个ROM都是硬编码的。

1 个答案:

答案 0 :(得分:0)

Logcat只能为每个错误显示一定数量的字符并记录应用输出。以前在What is the size limit for Logcat and how to change its capacity?

中已经回答过这个问题

此错误也与第2行的问题有关。您可能需要检查所有xml布局文件,看看是否有任何可疑的外观线。该日志并没有真正显示该类有一个错误膨胀的类。我还会检查所有自定义xml对象,例如自定义LinearLayout等...以查找任何错误。