Evaristo
Evaristo

Reputation: 41

Flutter image_picker video gallery OSError: Operation not permitted [Errno 1] IOS 13

I am using flutter image_picker and almost all is good except for when i try to do something with file generated on pickVideo from gallery (just on IOS 13 real device) it give error:

OSError: Operation not permitted [Errno 1].

Some extrange is that this video file can play with video_player and i can work good with camera file and image pick file generated with image_picker, but video gallery file can not do another thing than play with video_player.

For example, trying to get file size or copy it to another file fails, code example:

var videoFile = await ImagePicker.pickVideo(source: ImageSource.gallery);

print("File path........${videoFile.path}");
print("...................Size: ${await videoFile.length()}");

Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;

File newfile = videoFile.copy("${appDocPath}/video.MOV");

I saw that all permissions are good, mainly NSPhotoLibraryUsageDescription on Info.plist, but it does not work.

I need to say that on android all is working fine.

I hope some one can help me.

Upvotes: 1

Views: 981

Answers (2)

Evaristo
Evaristo

Reputation: 41

I solve my problem using another library call file_picker, i think image_piker is not workin good since IOS 13, they need upgrade it.

Upvotes: 1

Jiten Basnet
Jiten Basnet

Reputation: 1820

please go through the documentation of Image_picker where it says for ios setup:

Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:

NSPhotoLibraryUsageDescription 
NSCameraUsageDescription 
NSMicrophoneUsageDescription 

https://pub.dev/packages/image_picker

Upvotes: 1

Related Questions