Flutter remove application document directory

Viewed 14

I'm trying to reset the whole application document directory with this code:

  final appDocumentDirectory = await getApplicationDocumentsDirectory();
  appDocumentDirectory.deleteSync(recursive: true);

But this gives me this error:

FileSystemException: Deletion failed, path = '/var/mobile/Containers/Data/Application/7635AE9B-5EF5-4471-9DC6-7D33C12EF97E/Documents' (OS Error: Operation not permitted, errno = 1)

How can I make this operation permitted?

0 Answers
Related