【问题标题】:ZXing barcode scan app error on camera launchZXing 条码扫描应用程序在相机启动时出错
【发布时间】:2014-12-17 06:04:02
【问题描述】:

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

很遗憾,Google 搜索已停止

这是来自 eclipse 的日志:

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;

感谢您的帮助!

【问题讨论】:

    标签: android barcode zxing google-search


    【解决方案1】:

    问题是一些 android 设备没有 zxing 库,我必须安装 zxing 团队的条形码扫描仪才能让我的应用程序在没有该库的设备上工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-21
      • 2012-02-20
      • 1970-01-01
      • 1970-01-01
      • 2011-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多