Failed to write data to file flutter iOS

Viewed 21

im trying to use video_thumbnail package to generate thumbnail for my videos. in android everything works fine but in the ios simulator it has an error. here is my code:

 Future<void> genThumbnailFile(String videoUrl) async {
    var directory;
    if (GetPlatform.isAndroid) {
      directory = (await getTemporaryDirectory()).path;
    } else {
      directory = (await getApplicationDocumentsDirectory()).path;
    }
    fileName = await VideoThumbnail.thumbnailFile(
      video: videoUrl,
      imageFormat: ImageFormat.WEBP,
      thumbnailPath: directory,
      quality: 75,
    );
  }

The full error text is: [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Error 512, NSCocoaErrorDomain, The file “Documents” couldn’t be saved in the folder “835F430B”., null) [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(IO Error, Failed to write data to file, null, null)

0 Answers
Related