Cleveroad / Cleveroad/cr_file_saver

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

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
3
Forks
11
PR merge metrics
No merged PRs in 30d

Description

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);`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing CRFileSaver.saveFile() on an Android SDK 28 emulator and follow the FileSaverImpl saveFileBeforeSDK29 path shown in the log. Compare the behavior with Android 12 and verify that saving the file created from getTemporaryDirectory() completes without EACCES and returns successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, flutter, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.