Bug 38987 - WebView: can go back handling throws NullReferenceException on Samsung devices
Summary: WebView: can go back handling throws NullReferenceException on Samsung devices
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Paul DiPietro [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-02-22 14:06 UTC by Stefan Reinhard
Modified: 2017-06-19 17:41 UTC (History)
2 users (show)

Tags: webview nre
Is this bug a regression?: ---
Last known good build:

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 NORESPONSE

Description Stefan Reinhard 2016-02-22 14:06:25 UTC
Overview

In our Xamarin.Forms app, we use WebViews in various places like login flows with OAuth. One of those flows is connecting your facebook account with our backend. While this works on most devices, it fails on Samsung Galaxy S6 (SM-G920F) after the user has entered his credentials with the flowing exception:

UNHANDLED EXCEPTION:
System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.Android.WebViewRenderer.UpdateCanGoBackForward () [0x0000c] in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.WebViewRenderer+WebClient.ShouldOverrideUrlLoading (Android.Webkit.WebView view, System.String url) [0x0003b] in <filename unknown>:0 
  at Android.Webkit.WebViewClient.n_ShouldOverrideUrlLoading_Landroid_webkit_WebView_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_view, IntPtr native_url) [0x00019] in /Users/builder/data/lanes/2692/e98e9627/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Webkit.WebViewClient.cs:894 
  at (wrapper dynamic-method) System.Object:45c3d66f-58bb-4b79-a5ea-c02d11784f0c (intptr,intptr,intptr,intptr)

Steps to Reproduce:

1) Open a WebView with the facebook OAuth flow
2) Enter credentials an press login

Actual Results:

Exception is thrown an app crashes.

Expected Results:

WebView should get the access token.

Build Date & Hardware:

Xamarin.Android

Version: 6.0.1.10 (Business Edition)
SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23


Xamarin.Forms

Version: 2.0.1.6505

Affected Device

Android: 5.1.1
Manufacturer: samsung
Model: SM-G920F

Additional Builds an Platforms:

Doesn't occur in Android emulators and Google Nexus 5X and Google Nexus 5
Comment 1 Paul DiPietro [MSFT] 2017-03-24 23:09:02 UTC
Is this issue still occurring for you on the latest stable versions of everything, and if so, could you please provide a reproduction?
Comment 2 Chris King 2017-06-19 17:22:13 UTC
Assigned to you as you were last to request additional info.
Comment 3 Paul DiPietro [MSFT] 2017-06-19 17:41:04 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket and attach a project that demonstrates the issue.

Thanks!