-
Notifications
You must be signed in to change notification settings - Fork 760
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
File Path Issue in iOS 13.1 #346
Comments
Hi there, this Problem also occurs on iOS 13 "Live Version", so its not Beta-related. "file:///private/var/mobile/Containers/Data/PluginKitPlugin/D61F8E95-612D-4CB3-94BB-26ADDF68F26A/tmp/trim.76E14050-7A9F-430F-B13F-1A8758033345.MOV" which breaks window.resolveLovalFileURL with FileError 1. This happens on any physical Devices, we tested it so far - but for some Reasons, does not happen in an emulated Device in XCode. A Fix for iOS13 or a Hint, how to work around this, would be really helfull. Thanks, |
I’m wondering if this could be related to the sandbox security issue fixed in 13.1.1. Will investigate tomorrow and report back if 13.1.1 seems to fix this. |
13.1.1 is not fixing this - sadly... |
Yeah, tested this morning on my case as well and 13.1.1 did not help the matter. |
I have the same problem, has anyone managed to make it work on iOS 13? |
iOS & iPad OS 13.1.2 were released a few hours ago. Will test and report back... Edit: I no longer receive paths starting with /private/ and my app is working again. |
Sadly, the Issue is not fixed in 13.1.2 - at least not for Videos, which we have Focus on. |
Do you copy the temporary image to the cordova.file.applicationDirectory directory? |
Sorry I have to correct myself. A bug in my debug build acted as a workaround...it's still broken. Instead of having something like |
Still seeing the issue on our end with 13.1.2 unfortunately. |
This is probably not a lasting solution, but I managed to restore functionality for uploading videos from the photo library in my app, so I guess that's good :) The problem is in This is what worked for me: |
I have added the lines of your code to the camera plugin, removed and re-added the iOS platform and compiled, it is true that the path of the photo seems correct, but it still does not show the photo that I copied and pasted in the cordova.file.applicationDirectory in iOS 13.1.2 |
Please have a look at this issue in cordova-plugin-camera: The fix provided in this comment worked for us! |
I have the same issue, are you fixed or found solution?Thanks. @boredom2 |
Am am having this save issue in 13.1.2. Would be grateful to anyone who finds a solution to accessing resolveLocalFileSystemURL when selecting a video from the gallery. |
I applied that fix and it didn't work. I keep getting an As mentioned below. the file oddly still has this weird prefix @kkabel 's fix is confirmed working! |
cleanup for bugfix apache/cordova-plugin-file#346 apache#506 (comment)
@kkabell it seems like it's working and
Any ideas? |
Sounds like you're CSP is not setup properly. I've provided some references below. https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/#content-security-policy You need to allow the |
@breautek Thanks! my CSP was fine... I had also upgraded my webview to |
you save my day dude. thanks a lot. |
Well the problem is with the apache cordova camera plugin it provides the temporary path to the video file to come out from this error implement below changes in camera plugin. in CDVCamera.m change THIS:
to THIS:
Hope it will help you. And ofcourse you should perform this also
|
Unfortunately, doesn't work for me ;( |
iphone6s 12.0 same here works on simulator, but not real device |
I recently updated my copy of |
Maybe this may help anybody who struggles with this too ... we had the exact same effect after hours and hours bangign our heads against all walls in the office |
I resolved this by using the application storage on iOS, rather than the "data directory".
|
I've solved the same problem in other environment It’s look like iOS bug (detected only in Swift code) let result = fileManager.fileExists(atPath: path, isDirectory: &isDirectory) // false Using path.absoluteURL.path without prefix 'file://' Hope it will help |
Maybe it is not the issue of file plugin, It seems like it is issue of Cordova-camera plugin. I have solved this issue just by removing and adding camera plugin in my application, You should try this too. The changes in Cordova-camera plugin which solves the issue are as following: |
Wow, so cool, my issue finally is solved because of your reply what you give here, thank you very much. |
maybe adjacently useful code, borrowed from thebaselab/codeapp which uses this logic to cover the /private/ issue in another context
|
Hi All,
|
Bug Report
Problem: Local file path returns incorrectly on iOS 13.1
What is expected to happen?
cordova.file.applicationDirectory
returns a file path which is supported byresolveLocalFileSystemURL
to parse out a local path path for use in a cordova app.What does actually happen?
cordova.file.applicationDirectory
now returns a file path prefixed with/private/
which is incorrectly parsed byresolveLocalFileSystemURL
to produce an incorrect file path for use in a cordova app.Information
This issue exists is the iOS 13.1 beta, which is due to release at the end of September. Being this early in a beta, it's difficult to determine whether iOS is broken, or the plugin is broken, but to be proactive I am assuming the latter.
I've dug through the 13.1 release notes, and don't see anything jumping out at me that'd modify the local file storage directory paths. With recent changes to the HTML5 app guidelines over the Summer, I figure this could be a rogue change of sorts to modify how apps are being sandboxed/given access to the file system.
Testing to reproduce this, I was building my iOS app to two physical iPhone XR's, one on iOS 13 Gold Master, and one on iOS 13.1 Beta 3 and comparing file paths returned by the plugin.
Command or Code
cordova.file.applicationDirectory
window.resolveLocalFileSystemURL
Environment, Platform, Device
iPhone XR iOS 13.1 Beta 3
Version information
cordova-plugin-file 6.0.2
Checklist
The text was updated successfully, but these errors were encountered: