小编Mau*_*ini的帖子

Flutter:file_picker_error,无法创建临时文件

我在 Mac M1 上的 flutter 代码中收到此错误:

[MethodChannelFilePicker] 平台异常:PlatformException(file_picker_error,无法创建临时文件,错误域= NSItemProviderErrorDomain代码= -1000“无法加载类型public.item的表示” UserInfo = {NSLocalizedDescription =无法加载类型public.item}的表示, null)[VERBOSE-2:ui_dart_state.cc(209)]未处理的异常:PlatformException(file_picker_error,无法创建临时文件,错误域= NSItemProviderErrorDomain代码= -1000“无法加载类型public.item的表示” UserInfo = {NSLocalizedDescription =无法加载类型public.item的表示},null)

final result = await FilePicker.platform.pickFiles(
    allowMultiple: false,
    type: FileType.image,
);
Run Code Online (Sandbox Code Playgroud)

我还在 info.plist 中插入了这段代码:

<key>UIBackgroundModes</key>
<array>
    <string>fetch</string>
    <string>remote-notification</string>
</array>
<key>NSAppleMusicUsageDescription</key>
<string>Explain why your app uses music</string>
<key>UISupportsDocumentBrowser</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
Run Code Online (Sandbox Code Playgroud)

有什么建议么?

macos ios flutter

13
推荐指数
1
解决办法
3961
查看次数

标签 统计

flutter ×1

ios ×1

macos ×1