【问题标题】:Barcode scanning on Android?Android上的条码扫描?
【发布时间】:2020-09-23 19:22:12
【问题描述】:

我有一个适用于 android 的应用程序,它具有扫描条形码的功能,我目前在项目中使用 Google Vision 库,它在几天前还可以正常工作,它提供了以下内容错误:

06-04 12:19:18.979  6752  9626 I ChmraDebugLogger: [11] com.google.android.gms.vision.barcode
06-04 12:19:18.987 15536 16738 W DynamiteModule: Local module descriptor class for com.google.android.gms.vision.barcode not found.
06-04 12:19:18.987 15536 16738 I DynamiteModule: Considering local module com.google.android.gms.vision.barcode:0 and remote module com.google.android.gms.vision.barcode:0
06-04 12:19:18.988 15536 16738 E Vision  : Error loading module com.google.android.gms.vision.barcode optional module true: gf: No acceptable module found. Local version is 0 and remote version is 0.
06-04 12:19:18.988 15536 16738 I Vision  : Request download for engine barcode is a no-op because rate limiting
06-04 12:19:18.989 15536 16738 W DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite.barcode not found.
06-04 12:19:18.990  6752  9626 W ProviderHelper: Unknown dynamite feature vision.dynamite.barcode
06-04 12:19:18.998 15536 16738 I DynamiteModule: Considering local module com.google.android.gms.vision.dynamite.barcode:0 and remote module com.google.android.gms.vision.dynamite.barcode:0

我挖了很多,尝试了很多解决方案,包括清除数据、撤销和授予摄像头权限等等……但都没有奏效。

请问有没有我可能忘记测试的解决方案,或者有更好的开源库(不包括 ZXing,因为它处于维护模式)可以使用。

注意:日志中最重要的部分是 Request download for engine barcode is a no-op because rate limiting,我不知道为什么会这样。

【问题讨论】:

  • 你也可以使用firebase vision one,github上已经有一个示例repo
  • @Abdul - Firbase MLKit 处于测试阶段,我无法在生产中使用它。
  • 你试过谷歌的sample code吗?

标签: android barcode google-vision


【解决方案1】:

我和很多开发者一样长期使用 Zxing 库,但是在 Zxing 进入维护模式后,我开始使用旅程应用程序。你绝对可以检查它,我在一个严肃的商业应用程序中使用这个库,一年多以来没有任何问题。每天使用手机摄像头扫描大约 300.000 个条码。这是链接:https://github.com/journeyapps/zxing-android-embedded

【讨论】:

【解决方案2】:

您可以尝试谷歌的示例代码(https://github.com/googlesamples/android-vision/tree/master/visionSamples/barcode-reader)来验证GMS是否可以正常工作。

如果您的 GMS 无法运行,您可能需要对其进行更新。如果您的 GMS 可以工作,请参考 Google 的示例代码修改您的项目。

【讨论】:

  • 如果您正确阅读了这个问题,我已经提到我使用的是视觉,并且基于谷歌示例代码
  • 所以?您没有提到 Google 的示例代码是否可以工作。
  • 是的,它一直在工作,直到我遇到问题:Request download for engine barcode is a no-op because rate limiting,我不知道为什么!
  • @MaskedMan 我最近测试了 Google 的代码,一切都在我的系统上运行良好。您的 GMS 版本是多少?
  • 原来是18.0.0,但我更新为20.1.0,问题依然存在。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-11
  • 1970-01-01
相关资源
最近更新 更多