【发布时间】:2021-07-11 16:31:39
【问题描述】:
我正在尝试在 Flutter 中构建一个自定义桌面应用程序,以便能够加载图片,例如图库。 为此,我会要求用户选择一个文件夹,然后它会自动显示图片。
现在,从简单的事情开始,由于是第一次为Mac开发,我只是尝试通过Image.file(new File)方法显示图片。
The issue that I got back is
======== Exception caught by image resource service ================================================
The following FileSystemException was thrown resolving an image codec:
Cannot open file, path = 'media/preview.jpg' (OS Error: Operation not permitted, errno = 1)
我在想某种程度上与权利有关。 我的权利是:
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.assets.downloads.read-write</key>
<true/>
<key>com.apple.security.assets.pictures.read-write</key>
<true/>
<key>com.apple.security.assets.downloads.read-write</key>
<true/>
但是由于我要加载图片的文件夹可能在任何地方,我想知道这是否是我收到错误的原因。
【问题讨论】: