-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
File Plugin hangs when writing a file to Application Directory with ionic-plugin-cordova-webview installed #2067
Comments
Any updates to this? I am experiencing this same exact issue... I use Ionic Pro Live Deploy and it's always just the first time an update is downloaded, extracted and the app reloaded where files cannot be written. As soon as the app is closed and restarted, it'll work just fine. |
Still no update :( Maybe this is a permissions issue on iOS? |
I have the same issue except it is a file read that hangs, not a write. |
I was seeing this issue as well and noticed a small error in the cordova-plugin-file I have fixed it on a fork of the project for our team and it seems to be working consistently for us now: You can try out our version of the plugin by running these commands:
I will be submitting a PR to the cordova-plugin-file project soon. Hopefully this helps you guys |
I can't seem to be able to install your version of the plugin wfairclough. |
@Jahrenski Are you seeing any errors? Maybe I can help. No response from the maintainers yet. I am not sure when it will get merged, but I hope so as well. |
I'm probably doing it wrong. Edit: I searched for this problem and it seems that we need to include polyfill.js before cordova.js in the index.html file. This fixes the filereader problem as well. |
Hmm. Not too sure. It seems like it may be related to running the command on windows. This issues on npm may have some useful information: npm/npm#2333 |
Not all hero wear capes, @wfairclough I love you, thx a lot for the solution! I was facing the same error #2750 and patching manually my local @wfairclough did you submitted a PR to https://github.com/apache/cordova-plugin-file ? If no, go go go go for it 👍 |
hahaha now for me as I stated above |
@peterpeterparker A PR was merged into cordova-plugin-file PR#273 back in July, although I have not seen any package published to the npm registry with my change yet. |
Not sure but it looks like the other unreleased modifications of @jcesarmobile apache/cordova-plugin-file@cc3aedb also improves a bit the situation, I don't always face the same problem with |
My gosh, I think I found the root reason of my above problem regarding The thing is, I was still referencing Removing this explicit call to To summarize:
|
suitespot/cordova-plugin-file@2a0da7f This seems to have fixed my problem not being able to write to a file in the dataDirectory. I just manually made the change to the plugin in www directory and platform_www. Verifying on all phones. Thanks |
Closing as the bug was on file plugin and it's released already |
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
Current behavior:
With WebView installed, the Cordova File Plugin hangs when I try to use writeFIle. It does not raise an exception, it does not log anything in .catch or .then, it just enters the method and never returns.
I am assuming this has to do with the file:// issue. I am trying to write to the application directory with locations like file:///var/mobile/Containers/Data/Application/D6326230-58CE-4776-8D38-DB495D1CD551/Library/NoCloud/downloaded-assets/d4f3fcc4-ec81-4634-900f-3f47e433f74c/
The part that is strange to me is that killing the app and restarting makes everything work exactly as expected. Looking at the logs, it does not seem like any of the data I am passing to these methods has changed at all.
Another wrinkle: the app will work fine on first download from the app store. However, if I use Ionic Deploy to push new Javascript, the app fails as described above. Upon killing the app and restarting after a Deploy, the app resumes to normal function.
Expected behavior:
After an Ionic Deploy, I should be able to write and read files from the Application Directory without any issues.
Steps to reproduce:
Create an iOS Ionic App that has the webview plugin. Deploy some javascript using Ionic Deploy. Download a blob and use file.writeFile to save the blob in the Application Directory. The app hangs.
Related code:
Other information:
package.json info:
The text was updated successfully, but these errors were encountered: