简体   繁体   English

Flutter image_picker 视频库 OSError: Operation not allowed [Errno 1] IOS 13

[英]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:我正在使用 flutter image_picker 并且几乎所有东西都很好,除了当我尝试对从库中的 pickVideo 上生成的文件执行某些操作时(仅在 IOS 13 真实设备上)它给出错误:

OSError: Operation not permitted [Errno 1]. OSError:不允许操作 [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.一些extrange是这个视频文件可以用video_player播放,我可以很好地处理用image_picker生成的相机文件和图像选择文件,但是视频库文件除了用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.我看到所有权限都很好,主要是Info.plist上的NSPhotoLibraryUsageDescription ,但它不起作用。

I need to say that on android all is working fine.我需要说的是,在 android 上一切正常。

I hope some one can help me.我希望有一个人可以帮助我。

please go through the documentation of Image_picker where it says for ios setup:请通过 Image_picker 的文档 go 说明 ios 设置:

Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:将以下键添加到位于 /ios/Runner/Info.plist 中的 Info.plist 文件中:

NSPhotoLibraryUsageDescription 
NSCameraUsageDescription 
NSMicrophoneUsageDescription 

https://pub.dev/packages/image_picker https://pub.dev/packages/image_picker

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.我使用另一个库调用 file_picker 解决了我的问题,我认为 image_piker 自 IOS 13 以来无法正常工作,他们需要升级它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 颤振:“与设备的连接丢失。” 第二次使用 image_picker 从 iOS 上的图库中选择照片 - Flutter: 'Lost connection to device.' second time using image_picker to select photo from gallery on iOS Flutter Image_Picker 在打开相机时崩溃 iOS 应用程序 - Flutter Image_Picker crash iOS app when open Camera 从图库中选择图像时,image_picker 使应用程序崩溃 IOS,控制台中没有任何日志 - While picking an image from gallery, image_picker is crashing the the app on IOS with no logs in the console Flutter IOS 应用程序不会以 image_picker 启动:^0.6.3+4 - Flutter IOS app won't start with image_picker: ^0.6.3+4 image_picker:如果首先访问相机,则取消按钮在图库中不可见 - image_picker: Cancel button not visible in gallery, if camera was accessed first Flutter - FileSystemException:无法打开文件,路径 = '/path'(操作系统错误:不允许操作,errno = 1)在 ios - Flutter - FileSystemException: Cannot open file, path = '/path' (OS Error: Operation not permitted, errno = 1) on ios 操作系统错误:在 Flutter 应用程序中在 iOS 中创建文件夹时,不允许操作,errno = 1 - OS Error: Operation not permitted, errno = 1 when create folder in iOS in flutter app 有没有办法使用 Image_Picker 或来自 pub.dev 的类似插件从 Flutter 中的 ios 设备中选择 *.HEIC 文件? - Is there a way to pick *.HEIC files from an ios device in Flutter using Image_Picker or similar plugins from pub.dev? Flutter - 删除目录失败(操作系统错误:不允许操作,errno = 1) - Flutter - delete directory failed (OS Error: Operation not permitted, errno = 1) iOS Swift - 来自图书馆/画廊的视频选择器 - iOS Swift - Video picker from library/gallery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM