我正在尝试调试我们正在修改的供应商的Android应用程序以满足我们的需求,因此它不是我们的代码,问题不足以让他们修复。它正在Galaxy Tab 10.1上崩溃(在模拟器和Galaxy Nexus上正常运行),但每当应用程序崩溃时,我都无法获得完整的堆栈跟踪。它总是在行中间切断:at java.lang.reflect.Constructor.constructNative(Native M
。注意它甚至会阻止中间词。
我还直接从设备抓取了日志文件,它们显示相同的截止。
我可以看到它与GradesListAdapter.getView
有关。调试和步入该行会导致Android系统代码。
什么可能导致Android在其输出中停止中线?是否有其他方法来调试可能会产生更好结果的应用程序?
01-10 11:08:29.855 2033-2033/ E/AndroidRuntime﹕ FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:371)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
at com.ellucian.mobile.android.grades.GradesListAdapter.getView(GradesListAdapter.java:99)
at android.widget.AbsListView.obtainView(AbsListView.java:2472)
at android.widget.ListView.makeAndAddView(ListView.java:1775)
at android.widget.ListView.fillDown(ListView.java:678)
at android.widget.ListView.fillFromTop(ListView.java:739)
at android.widget.ListView.layoutChildren(ListView.java:1628)
at android.widget.AbsListView.onLayout(AbsListView.java:2307)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1589)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:678)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14072)
at android.view.ViewGroup.layout(ViewGroup.java:4657)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2004)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1825)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1120)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4604)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native M
01-10 11:08:29.905 2033-2037/ D/dalvikvm﹕ GC_CONCURRENT freed 388K, 12% free 8181K/9223K, paused 11ms+14ms, total 47ms
01-10 11:08:29.975 2141-2214/? E/android.os.Debug﹕ !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error
01-10 11:08:29.985 3361-3361/? I/dumpstate﹕ begin
答案 0 :(得分:0)
如this answer所述,单个logcat消息的大小约为4076字节。
在您的情况下,相关行已经在logcat输出中:
android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:371)at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)at com.ellucian.mobile.android.grades.GradesListAdapter.getView(GradesListAdapter.java:99)
显示您用于GradesListAdapter的布局是问题的根源。