-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Setting IsBusy causes exception/crash #9658
Comments
Could you attach a small sample where reproduce the issue?. Thanks in advance. |
Hi @ryanaw83. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Running this bare-bones MAUI app throws an exception at "IsBusy = true;" I am using the very latest version of MAUI (pulled directly from Github). |
For MAUI Android, same Exception encountered here. It happens everytime the app runs. Simply set IsBusy = true; |
|
Description
When setting IsBusy in OnAppearing event of a ContentPage it either throws an exception or crashes (on Android). In my main project, it crashes the application. When reproducing in a new MAUI app, it throws an exception having these details...
{System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: MauiContext should have been set on parent. at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view) in D:\a_work\1\s\src\Core\src\Platform\ElementExtensions.cs:line 110 at Microsoft.Maui.Controls.Platform.AlertManager.AlertRequestHelper.PageIsInThisContext(IView page) in D:\a_work\1\s\src\Controls\src\Core\Platform\AlertManager\AlertManager.Android.cs:line 316 at Microsoft.Maui.Controls.Platform.AlertManager.AlertRequestHelper.OnPageBusy(IView sender, Boolean enabled) in D:\a_work\1\s\src\Controls\src\Core\Platform\AlertManager\AlertManager.Android.cs:line 92 at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) --- End of inner exception stack trace --- at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Microsoft.Maui.Controls.MessagingCenter.Subscription.InvokeCallback(Object sender, Object args) in D:\a_work\1\s\src\Controls\src\Core\MessagingCenter.cs:line 96 at Microsoft.Maui.Controls.MessagingCenter.InnerSend(String message, Type senderType, Type argType, Object sender, Object args) in D:\a_work\1\s\src\Controls\src\Core\MessagingCenter.cs:line 225 at Microsoft.Maui.Controls.MessagingCenter.Microsoft.Maui.Controls.IMessagingCenter.Send[Page,Boolean](Page sender, String message, Boolean args) in D:\a_work\1\s\src\Controls\src\Core\MessagingCenter.cs:line 118 at Microsoft.Maui.Controls.MessagingCenter.Send[Page,Boolean](Page sender, String message, Boolean args) in D:\a_work\1\s\src\Controls\src\Core\MessagingCenter.cs:line 111 at Microsoft.Maui.Controls.Page.OnPageBusyChanged() in D:\a_work\1\s\src\Controls\src\Core\Page.cs:line 563 at Microsoft.Maui.Controls.Page.<>c.<.cctor>b__129_0(BindableObject bo, Object o, Object n) in D:\a_work\1\s\src\Controls\src\Core\Page.cs:line 36 at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) in D:\a_work\1\s\src\Controls\src\Core\BindableObject.cs:line 532 at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) in D:\a_work\1\s\src\Controls\src\Core\BindableObject.cs:line 466 at Microsoft.Maui.Controls.BindableObject.SetValue(BindableProperty property, Object value, Boolean fromStyle, Boolean checkAccess) in D:\a_work\1\s\src\Controls\src\Core\BindableObject.cs:line 388 at Microsoft.Maui.Controls.BindableObject.SetValue(BindableProperty property, Object value) in D:\a_work\1\s\src\Controls\src\Core\BindableObject.cs:line 362 at Microsoft.Maui.Controls.Page.set_IsBusy(Boolean value) in D:\a_work\1\s\src\Controls\src\Core\Page.cs:line 101 at MauiTestApp.MainPage.OnAppearing() in C:\Users\RyanWillis\source\repos\MauiTestApp\MauiTestApp\MainPage.xaml.cs:line 28 at Microsoft.Maui.Controls.Page.SendAppearing() in D:\a_work\1\s\src\Controls\src\Core\Page.cs:line 487 at Microsoft.Maui.Controls.ShellContent.SendPageAppearing(Page page) in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellContent.cs:line 150 at Microsoft.Maui.Controls.ShellContent.SendAppearing() in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellContent.cs:line 131 at Microsoft.Maui.Controls.ShellSection.PresentedPageAppearing() in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellSection.cs:line 958 at Microsoft.Maui.Controls.ShellSection.SendAppearing() in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellSection.cs:line 1060 at Microsoft.Maui.Controls.ShellItem.SendAppearing() in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellItem.cs:line 328 at Microsoft.Maui.Controls.ShellNavigationManager.<>c__DisplayClass16_0.g__WaitForWindowToSet|1(Object sender, EventArgs e) in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellNavigationManager.cs:line 242 at Microsoft.Maui.Controls.Element.OnChildAdded(Element child) in D:\a_work\1\s\src\Controls\src\Core\Element.cs:line 357 at Microsoft.Maui.Controls.ShellContent.OnChildAdded(Element child) in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellContent.cs:line 156 at Microsoft.Maui.Controls.ShellContent.set_ContentCache(Page value) in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellContent.cs:line 196 at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent() in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellContent.cs:line 81 at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) in D:\a_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\Android\ShellSectionRenderer.cs:line 123 at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_inflater, IntPtr native_container, IntPtr native_savedInstanceState) in C:\a_work\1\s\generated\androidx.fragment.fragment\obj\Release\net6.0-android\generated\src\AndroidX.Fragment.App.Fragment.cs:line 1999 at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(_JniMarshal_PPLLL_L callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, IntPtr p1, IntPtr p2) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 352}
Steps to Reproduce
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 10+
Did you find any workaround?
None, it happens every time (on Android), but I was not able to test it on iOS.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: