Bug 35733 - iOS WebView crashes when loading an URL with encoded parameters
Summary: iOS WebView crashes when loading an URL with encoded parameters
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.5.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Rui Marinho
Depends on:
Reported: 2015-11-10 08:13 UTC by Thibault Durand
Modified: 2016-04-06 19:11 UTC (History)
2 users (show)

Tags: ac iOS Xamarin.Forms Forms WebView Uri Crash
Is this bug a regression?: ---
Last known good build:

Xamarin.Forms project created with Xamarin Studio to demonstrate the crash (161.00 KB, application/zip)
2015-11-10 08:13 UTC, Thibault Durand

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Thibault Durand 2015-11-10 08:13:20 UTC
Created attachment 13758 [details]
Xamarin.Forms project created with Xamarin Studio to demonstrate the crash

*** Overview ***

When loading an URL using a Xamarin.Forms.WebView on iOS, 
the application will crash it the URL contains special characters such as the Swedish "Å" even when escaped with Uri.EscapeDataString

Error message is: 
Unhandled managed exception:
Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false. (System.Exception)


*** Steps to Reproduce ***

Run the sample project and click on the button that creates the crash. 

*** Environment Info ***

Mac OS 10.11.1
Xamarin Studio Version 5.9.8 (build 0)
Xcode 7.1 (9079) Build 7B91b
Version: (Business Edition)
Comment 1 Thibault Durand 2015-11-10 08:14:58 UTC
Note that this issue is similar to #29274 https://bugzilla.xamarin.com/show_bug.cgi?id=29247

In #29274 the issue was with Device.OpenUri

There is no problem opening the URL with Device.OpenUri. 
The problem only occurs when loading it in a WebView.
Comment 2 Rui Marinho 2015-11-17 09:19:22 UTC
Should be fixed in 1.5.2-pre3
Comment 3 Thibault Durand 2015-11-18 06:21:39 UTC
I have tried with and still get the crash. 

Comment 4 Rui Marinho 2015-11-18 06:46:09 UTC
Sorry this didn't get into 2.0, will be in the next release 2.0.1-pre1
Comment 5 Thibault Durand 2015-12-04 14:21:52 UTC
I don't see this bug mentioned in 2.0.1-pre1 release notes, was it indeed included in 2.0.1-pre1 or pushed back to another version? 

Comment 6 Rui Marinho 2015-12-04 18:54:38 UTC
Yes is fixed on pre1 , but missed from the release notes.
Comment 7 Thibault Durand 2015-12-07 14:17:51 UTC
I've just tested and can confirm that the crash is fixed on

Comment 8 Sascha Schwegelbauer 2016-04-06 19:11:29 UTC
Crash still occurs with german umlauts in the URI on