ml-kit - 条形码扫描 android - Google 代码扫描仪

问题描述 投票:0回答:2

我正在使用 Google 代码扫描仪 Android MLKit 进行条形码扫描。我正在使用以下依赖项。我希望使用捆绑模型,以便在启动应用程序时不占用初始化时间。有没有办法可以使用模型的捆绑版本:

请查找我为此使用的以下依赖项:

实现“com.google.android.gms:play-services-code-scanner:16.0.0”

AndroidManifest:

当我使用上述依赖项时,我在下载模型时看到以下异常: 等待Barcode UI模块下载。

有没有办法可以使用模型的捆绑版本,这样我就不需要等待下载 Barcode UI 模块。请帮我解决这个问题

提前致谢。

android kotlin barcode-scanner google-mlkit
2个回答
1
投票

这个怎么样:

dependencies {
  // ...
  // Use this dependency to bundle the model with your app
  implementation 'com.google.mlkit:barcode-scanning:17.1.0'
}

发现于:https://developers.google.com/ml-kit/vision/barcode-scanning/android


0
投票

根据此链接:https://developers.google.com/ml-kit/tips/installation-pathGoogle Play 服务代码扫描仪仅以非捆绑形式提供。 (它是通过google play服务下载的,似乎有点不可靠)

如果您想要捆绑模型,似乎您必须使用完整的 ML Kit 版本

'com.google.mlkit:barcode-scanning:17.2.0'
,如 SudoKoach 的答案所示。

© www.soinside.com 2019 - 2024. All rights reserved.