相机发布时ZXing条码扫描应用程序错误

时间:2014-12-17 06:04:03

标签: android barcode zxing google-search

我在Android应用中使用ZXing库,该应用实际上来自Tek Eye。我已经进行了修改并且效果很好,但在某些Android设备上,当我按下扫描按钮启动设备相机并开始扫描应用程序时会出错并退出。错误是:

  

不幸的是,谷歌搜索已停止

这是日食的日志:

12-17 13:38:33.396: I/System.out(2975): debugger has settled (1496)
12-17 13:38:33.411: D/dalvikvm(2975): open_cached_dex_file : /data/app/biz.tekeye.scanbarcode-2.apk /data/dalvik-cache/data@app@biz.tekeye.scanbarcode-2.apk@classes.dex
12-17 13:38:33.417: D/ActivityThread(2975): BIND_APPLICATION handled : 0 / AppBindData{appInfo=ApplicationInfo{414f0f58 biz.tekeye.scanbarcode}}
12-17 13:38:33.495: D/ActivityThread(2975): ACT-AM_ON_RESUME_CALLED ActivityRecord{414f56b8 token=android.os.BinderProxy@414f1c00 {biz.tekeye.scanbarcode/biz.tekeye.scanbarcode.Main}}
12-17 13:38:33.514: D/ActivityThread(2975): ACT-LAUNCH_ACTIVITY handled : 0 / ActivityRecord{414f56b8 token=android.os.BinderProxy@414f1c00 {biz.tekeye.scanbarcode/biz.tekeye.scanbarcode.Main}}
12-17 13:38:33.570: V/InputMethodManager(2975): onWindowFocus: null softInputMode=288 first=true flags=#8010100
12-17 13:38:33.571: V/InputMethodManager(2975): Starting input: view=com.android.internal.policy.impl.PhoneWindow$DecorView@414fcf78
12-17 13:38:33.572: V/InputMethodManager(2975): Starting input: tba=android.view.inputmethod.EditorInfo@41512238 ic=null
12-17 13:38:33.573: V/InputMethodManager(2975): START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView@414fcf78 ic=null tba=android.view.inputmethod.EditorInfo@41512238 controlFlags=#104
12-17 13:38:33.578: D/dalvikvm(2975): threadid=11: interp stack at 0x523ae000
12-17 13:38:33.579: D/jdwp(2975): sendRequest : Len=0x1D
12-17 13:38:33.579: V/InputMethodManager(2975): Starting input: Bind result=InputBindResult{null com.android.inputmethod.latin/.LatinIME #43}
12-17 13:38:33.581: D/jdwp(2975): processIncoming
12-17 13:38:33.581: D/jdwp(2975): handlePacket : cmd=0x9, cmdSet=0x9, len=0x13, id=0x2BF, flags=0x0, dataLen=0x8
12-17 13:38:33.584: D/jdwp(2975): processIncoming
12-17 13:38:33.585: D/jdwp(2975): handlePacket : cmd=0x5, cmdSet=0xB, len=0x13, id=0x2C0, flags=0x0, dataLen=0x8
12-17 13:38:33.587: D/jdwp(2975): processIncoming
12-17 13:38:33.587: D/jdwp(2975): handlePacket : cmd=0x1, cmdSet=0x9, len=0x13, id=0x2C1, flags=0x0, dataLen=0x8
12-17 13:38:33.588: D/jdwp(2975): processIncoming
12-17 13:38:33.588: D/jdwp(2975): handlePacket : cmd=0x2, cmdSet=0x9, len=0x1B, id=0x2C2, flags=0x0, dataLen=0x10
12-17 13:38:33.589: D/jdwp(2975): processIncoming
12-17 13:38:33.589: D/jdwp(2975): handlePacket : cmd=0x4, cmdSet=0xB, len=0x13, id=0x2C3, flags=0x0, dataLen=0x8
12-17 13:38:33.590: D/jdwp(2975): processIncoming
12-17 13:38:33.590: D/jdwp(2975): handlePacket : cmd=0x4, cmdSet=0xB, len=0x13, id=0x2C4, flags=0x0, dataLen=0x8
12-17 13:38:33.641: V/InputMethodManager(2975): Starting input: view=com.android.internal.policy.impl.PhoneWindow$DecorView@414fcf78
12-17 13:38:33.642: V/InputMethodManager(2975): Starting input: tba=android.view.inputmethod.EditorInfo@41513e88 ic=null
12-17 13:38:33.722: D/jdwp(2975): processIncoming
12-17 13:38:33.722: D/jdwp(2975): handlePacket : cmd=0x1, cmdSet=0xB, len=0x13, id=0x2C5, flags=0x0, dataLen=0x8
12-17 13:38:33.723: D/jdwp(2975): processIncoming
12-17 13:38:33.723: D/jdwp(2975): handlePacket : cmd=0x1, cmdSet=0xB, len=0x13, id=0x2C6, flags=0x0, dataLen=0x8
12-17 13:38:42.290: I/SurfaceTextureClient(2975): [STC::queueBuffer] this:0x518e7480, api:2, last queue time elapsed :8651 ms
12-17 13:38:42.290: I/SurfaceTextureClient(2975): [0x518e7480] frames:2, duration:8.651000, fps:0.231168
12-17 13:38:42.301: V/Provider/Setting(2975): from db cache, name = sound_effects_enabled value = 0
12-17 13:38:42.352: D/ActivityThread(2975): ACT-AM_ON_PAUSE_CALLED ActivityRecord{414f56b8 token=android.os.BinderProxy@414f1c00 {biz.tekeye.scanbarcode/biz.tekeye.scanbarcode.Main}}
12-17 13:38:42.399: D/ActivityThread(2975): ACT-PAUSE_ACTIVITY handled : 1 / android.os.BinderProxy@414f1c00
12-17 13:38:43.429: D/ActivityThread(2975): SEND_RESULT handled : 0 / ResultData{token=android.os.BinderProxy@414f1c00 results[ResultInfo{who=null, request=0, result=0, data=null}]}
12-17 13:38:43.430: D/ActivityThread(2975): ACT-AM_ON_RESUME_CALLED ActivityRecord{414f56b8 token=android.os.BinderProxy@414f1c00 {biz.tekeye.scanbarcode/biz.tekeye.scanbarcode.Main}}
12-17 13:38:43.431: D/ActivityThread(2975): ACT-RESUME_ACTIVITY handled : 1 / android.os.BinderProxy@414f1c00
12-17 13:38:43.441: V/InputMethodManager(2975): onWindowFocus: null softInputMode=288 first=true flags=#8010100
12-17 13:38:43.441: V/InputMethodManager(2975): Starting input: view=com.android.internal.policy.impl.PhoneWindow$DecorView@414fcf78
12-17 13:38:43.442: V/InputMethodManager(2975): Starting input: tba=android.view.inputmethod.EditorInfo@415191a8 ic=null
12-17 13:38:43.443: V/InputMethodManager(2975): START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView@414fcf78 ic=null tba=android.view.inputmethod.EditorInfo@415191a8 controlFlags=#104
12-17 13:38:43.446: V/InputMethodManager(2975): Starting input: Bind result=InputBindResult{com.android.internal.view.IInputMethodSession$Stub$Proxy@41519d38 com.android.inputmethod.latin/.LatinIME #45}
12-17 13:38:56.759: I/SurfaceTextureClient(2975): [STC::queueBuffer] this:0x518e7480, api:2, last queue time elapsed :13250 ms
12-17 13:38:56.759: I/SurfaceTextureClient(2975): [0x518e7480] frames:3, duration:13.360000, fps:0.224543
12-17 13:38:56.985: V/Provider/Setting(2975): from settings cache , name = sound_effects_enabled value = 0
12-17 13:38:57.090: D/ActivityThread(2975): ACT-AM_ON_PAUSE_CALLED ActivityRecord{414f56b8 token=android.os.BinderProxy@414f1c00 {biz.tekeye.scanbarcode/biz.tekeye.scanbarcode.Main}}
12-17 13:38:57.133: D/ActivityThread(2975): ACT-PAUSE_ACTIVITY handled : 1 / android.os.BinderProxy@414f1c00
12-17 13:38:58.317: D/ActivityThread(2975): ACT-DESTROY_ACTIVITY handled : 1 / android.os.BinderProxy@414f1c00

Android设备版本4.1.1(来自制造商IconBit的自定义版本)和4.3.1(来自制造商DNS的自定义版本)发生错误。但是,我已经尝试了4.1.1和4.3.2和4.2.1版本的几个设备并且应用程序正常运行。我不确定问题是什么以及Google搜索与该应用有什么关系。

调用意图的代码是:

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
switch(arg0.getId()){
case R.id.butQR:
    intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
    startActivityForResult(intent, 0);    //Barcode Scanner to scan for us
    break;

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

问题是有些Android设备没有zxing库,我不得不从zxing团队安装条码扫描程序,以便我的应用程序可以在没有该库的设备上工作。