Skip to content

Conversation

@potch8228
Copy link
Contributor

@potch8228 potch8228 commented Aug 21, 2025

Problem (as of 10.3.2)

Movie files bigger than 2GB(probably) couldn't be picked and loaded.
The same files could be loaded on Android.

This happened on both my Flutter project and the example app in this repository.

Log

Following logs were taken by adding extra error logging line (which starts with "#############") and running the example app in the repository.
I didn't change anything other than adding detailed error logging lines (and the few settings on Xcode project).

***** Picker:<PHPickerViewController: 0x10b6a0800> didFinishPicking:(
    "<PHPickerResult: 0x1209224f0>"
)
* -[FilePickerPlugin picker:didFinishPicking:] [Line 498]
* 
#############
############# imageData, loadError = Error Domain=NSCocoaErrorDomain Code=256 "The file “IMG_4088.mov” couldn’t be opened." UserInfo={NSFilePath=/private/var/mobile/Containers/Data/Application/4AA029B3-0E2F-4B35-99A3-0E6F2E771637/tmp/.com.apple.Foundation.NSItemProvider.rwwjhT/IMG_4088.mov, NSURL=file:///private/var/mobile/Containers/Data/Application/4AA029B3-0E2F-4B35-99A3-0E6F2E771637/tmp/.com.apple.Foundation.NSItemProvider.rwwjhT/IMG_4088.mov, NSUnderlyingError=0x118741050 {Error Domain=NSPOSIXErrorDomain Code=12 "Cannot allocate memory"}}

[ERROR:flutter/shell/common/shell.cc(1064)] The 'miguelruivo.flutter.plugins.filepickerevent' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.
See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.
flutter: [MethodChannelFilePicker] Platform exception: PlatformException(file_picker_error, Failed to process any images, Failed to load image data at index 0: The file “IMG_4088.mov” couldn’t be opened., null)
flutter: Unsupported operation: PlatformException(file_picker_error, Failed to process any images, Failed to load image data at index 0: The file “IMG_4088.mov” couldn’t be opened., null)

Tested device

iPhone SE (3rd Generation), iPhone XR

@potch8228 potch8228 changed the title Use NSFileManager to copy tmp data (from using bare NSData) [iOS] Use NSFileManager to copy tmp data (from using bare NSData) Aug 21, 2025
Copy link
Collaborator

@navaronbracke navaronbracke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Although, this will need a patch version bump & changelog entry.

@navaronbracke
Copy link
Collaborator

cc @vicajilau Does the

[ERROR:flutter/shell/common/shell.cc(1064)] The 'miguelruivo.flutter.plugins.filepickerevent' channel sent a message from native to Flutter on a non-platform thread

need a separate audit? We do need to use the main dispatch queue for those messages, hence the warnings.

@potch8228
Copy link
Contributor Author

potch8228 commented Oct 17, 2025

@navaronbracke
Thank you for your review and approval.
I committed CHANGELOG and bump the version code. I'm sorry that I didn't commit them from the beginning.

@navaronbracke
Copy link
Collaborator

@potch8228 No problem, and thank you for contributing!

@navaronbracke navaronbracke merged commit 9451206 into miguelpruivo:master Oct 17, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants