Skip to content
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

NullReferenceException when XAML Hot Reload (and other cases) #5

Open
casas333 opened this issue Mar 3, 2020 · 3 comments
Open

NullReferenceException when XAML Hot Reload (and other cases) #5

casas333 opened this issue Mar 3, 2020 · 3 comments

Comments

@casas333
Copy link

casas333 commented Mar 3, 2020

Hi,

I'm experiencing Null Reference exceptions, at least when the XAML Hot Reload is executed in a page where a Plugin.HibridWebView is located.

Steps to reproduce:

  1. Have a XAML page with a Plugin.HybridWebView
  2. Activarte XAML Hot Reload for Xamarin.Forms
  3. Debug the app to a device
  4. Make a change in the XAML and save. Hot Reload is executed

expected: Hot Reload is executed without any crash

current: app crashes because of a null reference exception in the HybridWebView dll.

Stack trace:

at Plugin.HybridWebView.Droid.HybridWebViewRenderer+<>c__DisplayClass34_0.<SetCurrentUrl>b__0 () [0x00016] in <2f2d06da51e84164a0ac7ab59cb79a28>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <d706cf8faf5542949900cf6d57864528>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <d706cf8faf5542949900cf6d57864528>:0 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.30(intptr,intptr)

Note: this is just one way that I know for sure makes the plugin crash but it's a more generic issue not really related to the Hot Reload itself, I think. I got this null reference exceptions in other scenarios I can't easily reproduce and explain right now.

@stoff99
Copy link

stoff99 commented May 7, 2020

+1

@candidodmv
Copy link
Contributor

Hello @casas333 I'm trying to understand why you are using HotReload in a HTML based control in case this control? does it make sense? Maybe you just need a control to apply a refresh on the control to update the rendering content.

Could you explain better your context to justify spend time in investigate this issue?

@casas333
Copy link
Author

Hi @candidodmv,

As I said in the note of my first message, I suspect this issue is not really related to the hot reload, but it was just a way to make the plugin crash. I don't know any other way of reproducing it. So

I was in page where I had de HybridWebView and was working on other page components UI. Suddenly, after a HotReload, the app crashed because of the component, that's it.

Thanks for the reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants