Android崩溃 - 如何调试?

时间:2014-06-02 18:04:27

标签: android eclipse

我在物理设备上运行的Android应用中遇到间歇性崩溃。该应用程序有几个屏幕,按钮和ListView。它有两个线程 - 主UI线程和通过WiFi接收信息的工作线程。工作线程永远不会直接触及任何UI组件。当它通过WiFi获取信息时,它使用 runOnUiThread 来调用写入将由UI读取的ArrayList的例程。

在我遇到崩溃的过去,我可以查看Debug Perspective的Debug选项卡中的堆栈跟踪,我找到了一些自己的代码,这是我的错误的好线索,但这个堆栈转储有我的没有什么 - 它都是内部的。此外,它只是说"运行时异常",而不是异常实际上是什么。 。

  

线程[< 1> main](Suspended(例外RuntimeException))
    ActivityThread.performStopActivityInner(ActivityThread $ ActivityClientRecord,     ActivityThread $ StopInfo,boolean)line:2434
    ActivityThread.handleStopActivity(IBinder,boolean,int)行:2479     ActivityThread.access $ 1800(ActivityThread,IBinder,boolean,int)   line:117 BinderProxy(ActivityThread $ H).handleMessage(Message)行:   952 ActivityThread $ H(处理程序).dispatchMessage(消息)行:99     Looper.loop()行:130 ActivityThread.main(String [])行:3687
    Method.invokeNative(Object,Object [],Class,Class [],Class,int,   boolean)line:not available [native method] Method.invoke(Object,   对象...)行:507 ZygoteInit $ MethodAndArgsCaller.run()行:842
    ZygoteInit.main(String [])行:600 NativeStart.main(String [])   line:not available [native method]

     

线程[< 8> Binder Thread#2](正在运行)

     

线程[< 7> Binder Thread#1](正在运行)

     

线程[< 9>> Thread-10](正在运行)

     

线程[< 10> Binder Thread#3](正在运行)

另一个因素:崩溃偶尔会发生,而且没有特定的序列可以重现它 - 它必须做一些事情 - 按下按钮或接收数据 - 它只是坐在桌子上不会崩溃什么都不做 - 但重现它并不总是一样的。

如何弄清楚我出错的地方?

1 个答案:

答案 0 :(得分:0)

这条线给了我一个预感:

Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available

它来自本机API这一事实表明它可能是API版本问题。检查您的问题视图(如果您正在使用Eclipse)并grep您的@SuppressLint注释代码,并确保您不会忽略或禁止任何“新API”或“内联API”编译器警告。

相关问题