java在安卓上的应用程序错误_android – 解决’应用程序已停止’崩溃错误

本文讨论了一个Android应用程序在与USB配件断开连接时出现的崩溃问题。当配件断开时,程序尝试切换回TCPIP模式并重新连接,但会触发一系列错误导致程序崩溃。logcat输出显示了具体的异常堆栈跟踪。
摘要由CSDN通过智能技术生成

构建AOA应用程序,我的

Android设备与外部附件通信,在这种情况下是arduino.

当我连接附件时,我的Android应用程序正确启动,因为我的mainActivity的intent-filter中有USB_ATTACHED操作.

但是,我的Android应用程序很可能在与USB配件断开连接时崩溃.

我的shell在断开连接时立即从TCPIP切换到USB模式但重新连接我得到完整的堆栈跟踪

任何Android专家都可以根据以下logcat输出建议我如何进一步调试吗?

E/run ( 5092): java.io.IOException: read failed: EIO (I/O error)

D/PicasaSyncManager( 4877): battery info: false

D/UsbDeviceManager( 781): exited USB accessory mode

E/UsbDebuggingManager( 781): got -1 reading

E/UsbDebuggingManager( 781): Communication error:

E/UsbDebuggingManager( 781): java.io.IOException: No such file or directory

E/UsbDebuggingManager( 781): at android.net.LocalSocketImpl.connectLocal(Native Method)

E/UsbDebuggingManager( 781): at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:287)

E/UsbDebuggingManager( 781): at android.net.LocalSocket.connect(LocalSocket.java:130)

E/UsbDebuggingManager( 781): at com.android.server.usb.UsbDebuggingManager.listenToSocket(UsbDebuggingManager.java:75)

E/UsbDebuggingManager( 781): at com.android.server.usb.UsbDebuggingManager.run(UsbDebuggingManager.java:111)

E/UsbDebuggingManager( 781): at java.lang.Thread.run(Thread.java:841)

D/dalvikvm( 781): GC_FOR_ALLOC freed 1069K, 14% free 31156K/35896K, paused 54ms, total 55ms

V/SearchControllerCache( 2819): creating SearchController

W/Sidekick_LocationOracleImpl( 2819): Best location was null

D/dalvikvm( 2819): GC_FOR_ALLOC freed 514K, 5% free 18100K/18940K, paused 15ms, total 15ms

D/audio_hw_primary( 182): select_devices: out_snd_device(0: ) in_snd_device(35: voice-rec-mic)

D/ ( 182): Failed to fetch the lookup information of the device 0000003E

E/ACDB-LOADER( 182): Error: ACDB AudProc vol returned = -19

I/SearchController( 2819): #onHotwordDetectorStarted

D/MainActivity( 5092): ASSERT registerPhone and register =false

D/MainActivity( 5092): ASSERT registerSms and register =false

I/WroxAccessory( 5092): disconnect

D/AndroidRuntime( 5092): Shutting down VM

W/dalvikvm( 5092): threadid=1: thread exiting with uncaught exception (group=0x41e7cba8)

E/AndroidRuntime( 5092): FATAL EXCEPTION: main

E/AndroidRuntime( 5092): Process: ca.foo, PID: 5092

E/AndroidRuntime( 5092): java.lang.RuntimeException: Unable to destroy activity {ca.foo/ca.foo.MainActivity}: java.lang.IllegalArgumentException: Receiver not registered: com.wiley.wroxaccessories.UsbConnection12$1@42f0be28

E/AndroidRuntime( 5092): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3497)

E/AndroidRuntime( 5092): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3515)

E/AndroidRuntime( 5092): at android.app.ActivityThread.access$1400(ActivityThread.java:135)

E/AndroidRuntime( 5092): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1249)

E/AndroidRuntime( 5092): at android.os.Handler.dispatchMessage(Handler.java:102)

E/AndroidRuntime( 5092): at android.os.Looper.loop(Looper.java:136)

E/AndroidRuntime( 5092): at android.app.ActivityThread.main(ActivityThread.java:5017)

E/AndroidRuntime( 5092): at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 5092): at java.lang.reflect.Method.invoke(Method.java:515)

E/AndroidRuntime( 5092): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)

E/AndroidRuntime( 5092): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)

E/AndroidRuntime( 5092): at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime( 5092): Caused by: java.lang.IllegalArgumentException: Receiver not registered: com.wiley.wroxaccessories.UsbConnection12$1@42f0be28

E/AndroidRuntime( 5092): at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:667)

E/AndroidRuntime( 5092): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1453)

E/AndroidRuntime( 5092): at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:489)

E/AndroidRuntime( 5092): at com.wiley.wroxaccessories.UsbConnection12.close(UsbConnection12.java:115)

E/AndroidRuntime( 5092): at ca.foo.MainActivity.onDestroy(MainActivity.java:164)

E/AndroidRuntime( 5092): at android.app.Activity.performDestroy(Activity.java:5403)

E/AndroidRuntime( 5092): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1117)

E/AndroidRuntime( 5092): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3484)

E/AndroidRuntime( 5092): ... 11 more

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值