'Flutter: file_picker_error, Temporary file could not be created
I am getting this error, in flutter code, on Mac M1:
[MethodChannelFilePicker] Platform exception: PlatformException(file_picker_error, Temporary file could not be created, Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.item" UserInfo={NSLocalizedDescription=Cannot load representation of type public.item}, null) [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: PlatformException(file_picker_error, Temporary file could not be created, Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.item" UserInfo={NSLocalizedDescription=Cannot load representation of type public.item}, null)
final result = await FilePicker.platform.pickFiles(
allowMultiple: false,
type: FileType.image,
);
I also inserted this code in 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/>
any suggestions?
Solution 1:[1]
Your info.plist should contain this permissions
<key>NSCameraUsageDescription</key>
<string>Requires Camera Usage</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Requires Photo Library Usage</string>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Paul Edem'kong |
