-
Notifications
You must be signed in to change notification settings - Fork 395
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
[BUG] Can't load a file from documents directory into the webview / '_file_' prefix causes SIGBART on iOS #133
Comments
I'm running into the same issue with 2.0.1 when using Ionic.WebView.convertFileSrc() to generate a URL from a file entry. To my novice eyes, it appears the file handler is getting set prior to CDV_LOCAL_SERVER bing defined. workaround - *serverUrl = @"http://localhost:8080" |
@JRR-OSU that means the file is missing from the filesystem |
Sorry messed up the merge request. Present now on #135 |
I'm seeing the same issues with accessing local files since the upgrade. I simply updated to cordova-plugin-ionic-webview v2 and it broke local file access for Android: I don't see any security/access related errors but also nothing shows, leaving images broken. On iOS it is even worse, I too see the dreaded "signal SIGABRT" error which leads to crashing the app:
|
@olivermuc try patching |
Excellent @matejkramny - I sincerely hope we can get this fix in asap. Awesome catch! |
@matejkramny Your MR worked perfectly for me. Thanks |
@matejkramny Thanks for posting a fix. I have no idea why the person that wrote this decided to put nil values everywhere with no nil checks. There are other issues with the range checks for and |
* fix nil reference to CDV_LOCAL_SERVER fixes ionic-team#133 * remove empty spaces * remove more empty spaces * rename local basePath variable
Wondering @matejkramny did you find a fix w Android? Or maybe @JRR-OSU or @olivermuc did you guys have Android issues? |
@Mapiac I didn't have issues on Android simply because I went with Crosswalk to avoid issues like this. Also I think Android avoided these issues altogether in the way that it handles the HTTP server. Previously the Ionic team used essentially a webserver plugin written by someone else on iOS that clearly didn't handle things like range requests properly. I think in the latest iterations they got rid of it. I needed to support devices back to iOS 9, so I just ended up fixing bugs myself. Was tedious as hell. Once I was able to get Crosswalk to build on Android, I've since had zero issues. Edit: Looks like they fixed Android in commit 6f18248. |
Hello |
I recently uncovered a treasure trove of bugs with this plugin after migrating to 2.0. Previously we were on 1.1.19 and had no issues loading a local audio file into a waveform on iOS. For my current project we need to update our plugin to > 2.0 to be able to interface with Ionic Pro, however this completely broke loading in local files into the waveform container on iOS.
This is the line that does it:
this.wavesurfer.load('_file_' + this.file.documentsDirectory.replace(/file:\/\//g, '')+ fileName);
Now previously, on 1.1.19, this line worked as, but this does not work on 2.0:
this.wavesurfer.load(this.file.documentsDirectory.replace(/file:\/\//g, '')+ fileName;
I've tried using
'_file_'
,"file://"
and"cdvfile://"
. None work.When trying with the
'_file_'
prefix, I get a SIGBART on iOS.Bug 1:
self.CDV_LOCAL_SERVER
is getting set to nil somewhereBug 2: If I hard code the local server path, I get a SIGBART deep inside the engine code. Can post more on that later.
Is there something I'm missing here? I get that the webview now runs inside the local server with a different path, but how can i adjust my code to be able to load my waveform??
Help is needed urgently, thanks.
The text was updated successfully, but these errors were encountered: