-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
writeFile crashes #297
Comments
I have concluded it seems to be some problem with the write permissions. There is a note about Android 6.0 having that problem. |
I accidentally removed android from the app that had this working. I added Android 6.3 back which is what it had before. Now it also doesn't work. Some android file must be part of the problem. |
I think I give up. The new app still has the same problem. I am even seeing a problem with the write access between builds. Decided to do more testing. This was all testing on a Samsung S5 with Android 6.0.1 externalApplicationStorageDirectory --Did not work applicationStorageDirectory It looks like writing the file was successful but reading the file got this -- Error So pushing files to externalRootDirectory was my only hope. Changed code that if Android was 6 or less us externalRootDirectory/Download/ if its anything else (ios or Android > 7) use dataDirectory. Remove the plugin and installed it again. I really don't know what else to do this this plugin. |
@newuser44 #237 might fix your issue. I also spent many, many hours on this. |
|
It is merged but there hasn't been an npm release (no idea how Apache manages that). Instructions: danielsogl/awesome-cordova-plugins#2067 (comment) You can use this repo rather than the forked one either.
Pointing to git rather than an npm can be problematic, there is lots of ifs, buts, and maybes. I'd suggest googling around for the best solution for you. |
So danielsogl/awesome-cordova-plugins#2067 (comment) changed the files directly and that seemed to work for Android 6.0.1. But now on Android 4.4 phone go to open the file I get an error about can't find the path. I have tried dataDirectory that worked for all other phones (but I can't actually find this location on the phone). Just tried applicationStorageDirectory but that seems to be the same path on this older phone. Not sure what else is left? |
I realise that this issue is old but I'l give some (modern) answers...
With Android's scoped storage, enforced in API 30 and later, I'm unable to reproduce any "crashes", just errors as I would expect via the error callbacks. Hope this helps, if the issue persists with the current versions of the platform/plugin, then please create a new issue with updated information. |
Bug Report
Problem
On a Samsung S5 with Android 6.0.1 calling writeFile crashes somewhere.
What is expected to happen?
Save a file.
What does actually happen?
I have tried to debug it down into the maybe FileWriter.js and see it trying to write the file. But then the debugger stopped stepping through code. Something crashed and its not being caught.
Information
Not sure if the problem is the Samsung or Android 6.0. Build this onto a phone.
Would need to some type of blob that is getting saved as a PDF document.
Try to save the file.
Environment, Platform, Device
I only have the problem on a Samsung S5 running Android 6.0.1
This worked fine on
-- Pixel 2 (not sure the os 8 or 9)
-- Samsung S7 with android 8.
-- iphone 8 and 9.
Version information
Ionic 3.9
Uninstalled and reinstalled. (following the Ionic 3 steps)
"@ionic-native/file": "^4.20.0",
"cordova-plugin-file": "~6.0.1"
Checklist
The text was updated successfully, but these errors were encountered: