Bug 30867 - ShouldStartLoad causes InvalidOperationException to be thrown when instantiating a webview
Summary: ShouldStartLoad causes InvalidOperationException to be thrown when instantiat...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.4.4
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-06 11:55 UTC by Cody Beyer (MSFT)
Modified: 2016-04-09 01:39 UTC (History)
3 users (show)

Tags: ac ios webview ra
Is this bug a regression?: ---
Last known good build:


Attachments
TestCase (658.01 KB, application/zip)
2015-06-06 11:56 UTC, Cody Beyer (MSFT)
Details


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:
Status:
RESOLVED ANSWERED

Description Cody Beyer (MSFT) 2015-06-06 11:55:05 UTC
### Description

The following app attempts to load a WebView at load. This throws an exception, as linked below

### Sample

Attached

### Exception 

https://gist.github.com/CodyBeyer/54a3d863649102c2e62f

### Steps to Reproduce

1. Download attached sample
2. Deploy to iOS Simulator

### Excepted Results

App should launch and display WebView

### Actual Results

App crashes with above linked exception

### Version

=== Xamarin Studio ===

Version 5.9.3 (build 1)
Installation UUID: fc65f77a-6bee-473f-8adb-6b27b14a8197
Runtime:
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

=== Xamarin.Android ===

Version: 5.1.3.1 (Business Edition)
Android SDK: /Users/codybeyer/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Version: 8.10.1.64 (Business Edition)
Hash: e6ebd18
Branch: master
Build date: 2015-05-21 21:55:09-0400

=== Xamarin.Mac ===

Version: 2.0.1.64 (Business Edition)

=== Build Information ===

Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

=== Operating System ===

Mac OS X 10.10.3
Darwin Codys-MacBook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Cody Beyer (MSFT) 2015-06-06 11:56:17 UTC
Created attachment 11491 [details]
TestCase
Comment 2 Chris King 2015-06-09 19:47:12 UTC
Thanks for taking the time to submit this issue. The exception is thrown because internally we've already attached a delegate (UIWebViewDelegate) to the webview and mixing delegate based eventing with the C# eventing is not supported. I'd guess we'll expose the event you're trying to access as a first class citizen so you wouldn't have to make a custom renderer however we're reviewing internally how to best support this scenario.

Warm regards,
Xamarin Forms Team