Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
ObjCRuntime.RuntimeException: Unable to locate the block to delegate conversion method for the method EBADersIOS.NavigationDelegate.ForNavigationResponseDecidePolicy's parameter #3.
public void ForNavigationResponseDecidePolicy(WKWebView webView, WKNavigationResponse navigationResponse, Action<WKNavigationResponsePolicy> decisionHandler)
NSHttpUrlResponse response = (NSHttpUrlResponse)navigationResponse.Response;
NSHttpCookie cookies = NSHttpCookie.CookiesWithResponseHeaderFields(response.AllHeaderFields, response.Url);
foreach (NSHttpCookie cookie in cookies)
@Suat can you please include your full build logs, crash reports (if any),
test case (to reproduce) and all version informations.
The easiest way to get exact version information is to use the
"Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details"
button and copy/paste the version informations (you can use the
"Copy Information" button).
@Suat, this is normal. If you manually/directly export methods, using an [Export] attribute, then you are responsable to include any needed marshalling code, e.g. to turn a C# delegate into a ObjC block.
If you look (assembly browser) how Xamarin.iOS.dll define it's own binding you'll see the last parameter had a [BlockProxy] attribute, which points to extra code...
You _could_ do the same but this is not easy and not something we recommend. You can avoid doing this using one of the two following patterns:
1. Subclass the WKNavigationDelegate (model) class, and override the DecidePolicy member, see http://stackoverflow.com/a/36559932/220643
2. if you cannot subclass then have your existing type implement the `IWKNavigationDelegate` interface and add your method with this signature
> public void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, Action<WKNavigationActionPolicy> decisionHandler)
> // your code
This will _link_ your method with the (complete) binding of the ObjC protocol - and XI runtime will know it has to marshal the C3 delegate into a block.