-
Notifications
You must be signed in to change notification settings - Fork 42
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
VirtualView cannot be null here #91
Comments
I also saw the same crash in my google play console, but unfortunately can't reporduce that.
|
I just found the same issue on version 1.3.0 after the merge of #100 System.InvalidOperationException: 'VirtualView cannot be null here' The scenario is when I try to close the popup via the service
A workaround that I found is showing a alert before close the pop-up. In the situation that the bug happen, the pop-up is closed after a admob interstitial/reward ads is closed, then on the ads' close event happen, in this event, I close the pop-up. I change this behavior to show a alert before close the pop-up, this way the bug don't happen. My suspection is regarding the context of the application. Maybe I am trying to close the pop-up when its context is not in foreground. Showing a alert, it forces the user to back to the app context and then I am able to close the pop-up without any issue. |
@LuckyDucko, I don't think this should be closed, as the issue is still occurring, as pointed out by @MarcosCostaDev. @MarcosCostaDev, what do you mean by showing an alert before closing the popup? Can you share a code sample? |
@romerotg showing an alert means executing the alert function from the view model, like the code below.
I execute the alert, then I close the popup via ViewModel using the function The error happens if I call The scenario is specific. The event is triggered by the AdMob plugin when the ads close the interstitial ads and it will execute the |
I created a PR to fix this issue #107 . Sometimes the |
@LuckyDucko +1 we also encountered this bug, fix looks to work would like to have a new package :) |
I'm experiencing the same issue .is there any workaround? |
@abdullahraiyyan try to call an alert before closing the popup, this works for me. However, there is a PR #107 with the bugfix |
@mkazimoto this looks like not be part of the Mopups. |
Microsoft.Maui.Handlers.ViewHandler2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].get_VirtualView() Mopups.Platforms.Android.Renderers.PopupPageRenderer.OnLayout(Boolean changed, Int32 left, Int32 top, Int32 right, Int32 bottom) Android.Views.ViewGroup.n_OnLayout_ZIIII(IntPtr jnienv, IntPtr native__this, Boolean changed, Int32 l, Int32 t, Int32 r, Int32 b) Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPZIIII_V(_JniMarshal_PPZIIII_V callback, IntPtr jnienv, IntPtr klazz, Boolean p0, Int32 p1, Int32 p2, Int32 p3, Int32 p4)
The text was updated successfully, but these errors were encountered: