【发布时间】:2020-01-30 09:18:46
【问题描述】:
我在一个颤振应用程序中使用颤振 image_picker_saver 插件。它在 iOS 13 以下工作正常。在 iOS 13 中它给出了一个错误。请告知
代码:
final byteData = await image.toByteData(format: ImageByteFormat.png);
Uint8List pngBytes = byteData.buffer.asUint8List();
var filePath = await ImagePickerSaver.saveFile(fileData: pngBytes);
print(filePath);
Flutter 版本:Flutter 1.9.1+hotfix.2 • 通道稳定 • https://github.com/flutter/flutter.git 框架 • 修订版 2d2a1ffec9 (3 周前) • 2019-09-06 18:39:49 -0700 引擎 • 修订版 b863200c37 工具 • Dart 2.5.0
Flutter Doctor:医生摘要(要查看所有详细信息,请运行 Flutter Doctor -v): [✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-US)
[✓] Android 工具链 - 为 Android 设备开发(Android SDK 版本 29.0.1) [✓] Xcode - 为 iOS 和 macOS 开发 (Xcode 11.0) [✓] Android Studio(3.4 版)[✓] VS Code(1.38.1 版)[✓] 已连接的设备(1 个可用)
• 未发现任何问题!
Xcode Log: unner[32641:729850] 保存图片成功 2019-09-26 09:37:58.007237+0300 Runner[32641:729850] [core] “错误返回 守护进程:错误 Domain=com.apple.accounts Code=7 "(null)"" 2019-09-26 09:37:58.041160+0300 Runner[32641:729723] 成功 public.png { PHImageFileDataKey = {长度 = 1715209,字节 = 0x89504e47 0d0a1a0a 0000000d 49484452 ... 49454e44 ae426082 }; PHImageFileOrientationKey = 0; PHImageFileUTIKey = "public.png"; PHImageResultIsDegradedKey = 0; PHImageResultRequestIDKey = 1; } 2019-09-26 09:37:58.041279+0300 Runner[32641:729723] 成功 PHImageFileURLKey (null) 2019-09-26 09:37:58.044804+0300 亚军[32641:729862] [VERBOSE-2:ui_dart_state.cc(148)] 未处理的异常:无效 论点
0 _StringBase.+ (dart:core-patch/string_patch.dart:263:57)
1 ImagePickerSaver.saveFile(包:image_picker_saver/image_picker_saver.dart:85:34)
【问题讨论】:
-
用最新版本更新 image_picker_saver 插件后工作正常。感谢您的支持。 :)
-
我仍然面临同样的错误:
ImagePickerSaver.saveFile(fileData: bytes.buffer.asUint8List())我正在使用 image_picker_saver: 0.3.0