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

App got crashed on calling CRFileSaver.saveFile() method on emulator #13

Open
shivanuj13 opened this issue Jun 13, 2023 · 0 comments
Open

Comments

@shivanuj13
Copy link

On emulator ( SDK 28 ) saving file via CRFileSaver.saveFile() method results in app crashed with following error, However it's working properly in real device with android 12

D/FileSaverImpl(11496): saveFileBeforeSDK29: Saving /data/user/0/com.example.simple_invoice/cache/invoice.pdf
E/AndroidRuntime(11496): FATAL EXCEPTION: main
E/AndroidRuntime(11496): Process: com.example.simple_invoice, PID: 11496
E/AndroidRuntime(11496): java.io.FileNotFoundException: open failed: EACCES (Permission denied)

My code sample is :
final output = await getTemporaryDirectory();
final file = File('${output.path}/invoice.pdf');
await file.writeAsBytes(await pdf.save());
String? res = await CRFileSaver.saveFile(file.path);

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

1 participant