gpt4 book ai didi

Dart/flutter : iOS app crashes with Firebase ML Vision

转载 作者:行者123 更新时间:2023-12-03 17:32:10 25 4
gpt4 key购买 nike

我正在创建一个 Flutter 应用程序,它使用相机插件来拍摄图像然后处理它们。我正在使用 Firebase ML Vision 包来处理这些图像,但是当我在 iPhone 上运行该应用程序时,它崩溃了。

Here's an image of the stack trace

Here's an image of when I run "flutter doctor -v"

相关代码:

fetchImageAnnotations(File image) async {
final FirebaseVisionImage visionImage =
FirebaseVisionImage.fromFile(image);
final BarcodeDetector barcodeDetector =
FirebaseVision.instance.barcodeDetector();
final LabelDetector labelDetector =
FirebaseVision.instance
.labelDetector(LabelDetectorOptions(confidenceThreshold: 0.80));
final TextDetector textDetector =
FirebaseVision.instance.textDetector();

final List<Barcode> barcodes = await barcodeDetector.detectInImage(visionImage);
final List<Label> labels = await labelDetector.detectInImage(visionImage);
final List<TextBlock> blocks = await textDetector.detectInImage(visionImage);
}

如果有人可以提供帮助,将不胜感激。

最佳答案

你检查过iOS权限吗?您需要添加:

<key>NSCameraUsageDescription</key>
<string>Can I use the camera please?</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Can I use the photos library please?</string>
到 plist

关于 Dart/flutter : iOS app crashes with Firebase ML Vision,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51805583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com