Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CaptureAndSave is not working on android 10 and below #149

Closed
Piyush-e7 opened this issue Jul 10, 2023 · 2 comments
Closed

CaptureAndSave is not working on android 10 and below #149

Piyush-e7 opened this issue Jul 10, 2023 · 2 comments

Comments

@Piyush-e7
Copy link

Piyush-e7 commented Jul 10, 2023

CaptureAndSave is not working on Android 10 and below, but it's working fine on Android 11 and above.

I have to store screenshots in the download folder.

This is my code :

final folderDirectory = Directory("/storage/emulated/0/Download");
var data = await screenshotController.captureAndSave(folderDirectory.path, fileName: "filename.png");

This is the error:

E/flutter ( 1249): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FileSystemException: Cannot create file, path = '/storage/emulated/0/Download/Location-1688990710152985.png' (OS Error: Permission denied, errno = 13)
E/flutter ( 1249): #0 _checkForErrorResponse (dart:io/common.dart:42:9)
E/flutter ( 1249): #1 _File.create. (dart:io/file_impl.dart:269:7)
E/flutter ( 1249):
E/flutter ( 1249): #2 PlatformFilePickerWindows.saveFile (package:screenshot/src/platform_specific/file_manager/file_manager_io.dart:13:17)
E/flutter ( 1249):

Please give me the solution to this.

@Piyush-e7 Piyush-e7 changed the title CaptureAndSave is not working on android 10 and below 10 CaptureAndSave is not working on android 10 and below Jul 10, 2023
@egedib
Copy link

egedib commented Dec 28, 2023

If anyone comes here after googling this error:
This issue is not related to this package, on Android 10 and below you need the WRITE_EXTERNAL_STORAGE to write to shared storage, on 10 and above, you don't need it.

@ritheshSalyan
Copy link
Collaborator

Closing issue due to inactivity. If you think it is incorrect, feel free to reoprn this issue

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

No branches or pull requests

3 participants