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

FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null. (Parameter 'context') #28

Open
1 of 2 tasks
Jakar510 opened this issue Jun 6, 2024 · 1 comment

Comments

@Jakar510
Copy link

Jakar510 commented Jun 6, 2024

Description

FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null. (Parameter 'context')

Steps to Reproduce

  1. Make MAUI App with SettingsView test page.
  2. Run it, navigate to the page
  3. Boom...

Expected Behavior

Page displays and works

Actual Behavior

[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null. (Parameter 'context')
[mono-rt]    at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context) in D:\a\_work\1\s\src\Core\src\Platform\ElementExtensions.cs:line 59
[mono-rt]    at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context) in D:\a\_work\1\s\src\Core\src\Platform\ElementExtensions.cs:line 127
[mono-rt]    at AiForms.Settings.Platforms.Droid.SettingsViewRecyclerAdapter.BindContentView(ContentBodyViewHolder holder, Int32 position)
[mono-rt]    at AiForms.Settings.Platforms.Droid.SettingsViewRecyclerAdapter.OnBindViewHolder(ViewHolder holder, Int32 position)
[mono-rt]    at AndroidX.RecyclerView.Widget.RecyclerView.Adapter.n_OnBindViewHolder_Landroidx_recyclerview_widget_RecyclerView_ViewHolder_I(IntPtr jnienv, IntPtr native__this, IntPtr native_holder, Int32 position) in D:\a\_work\1\s\generated\androidx.recyclerview.recyclerview\obj\Release
et7.0-android\generated\src\AndroidX.RecyclerView.Widget.RecyclerView.cs:line 591
[mono-rt]    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLI_V(_JniMarshal_PPLI_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, Int32 p1) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 176
[mono-rt]    at Java.Interop.JniEnvironment.StaticMethods.CallStaticLongMethod(JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 21700
[mono-rt]    at Java.Interop.JniPeerMembers.JniStaticMethods.InvokeInt64Method(String encodedMember, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:line 147
[mono-rt]    at Microsoft.Maui.PlatformInterop.MeasureAndGetWidthAndHeight(View view, Int32 widthMeasureSpec, Int32 heightMeasureSpec) in D:\a\_work\1\s\artifacts\obj\Core\Release
et8.0-android\generated\src\Microsoft.Maui.PlatformInterop.cs:line 580
[mono-rt]    at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Handlers\ViewHandlerExtensions.Android.cs:line 93
[mono-rt]    at Microsoft.Maui.Handlers.ViewHandler`2[[AiForms.Settings.SettingsView, SettingsView, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[AiForms.Settings.Platforms.Droid.AiRecyclerView, SettingsView, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetDesiredSize(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.Android.cs:line 18
[mono-rt]    at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Layouts\LayoutExtensions.cs:line 27
[mono-rt]    at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Controls\src\Core\VisualElement\VisualElement.cs:line 1893
[mono-rt]    at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Measure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Controls\src\Core\VisualElement\VisualElement.cs:line 1880
[mono-rt]    at Microsoft.Maui.Layouts.VerticalStackLayoutManager.Measure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Layouts\VerticalStackLayoutManager.cs:line 31
[mono-rt]    at Microsoft.Maui.Controls.StackLayoutManager.Measure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Controls\src\Core\Layout\StackLayoutManager.cs:line 42
[mono-rt]    at Microsoft.Maui.Controls.Layout.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Controls\src\Core\Layout\Layout.cs:line 354
[mono-rt]    at Microsoft.Maui.Platform.LayoutViewGroup.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Platform\Android\LayoutViewGroup.cs:line 57
[mono-rt]    at Microsoft.Maui.Platform.LayoutViewGroup.OnMeasure(Int32 widthMeasureSpec, Int32 heightMeasureSpec) in D:\a\_work\1\s\src\Core\src\Platform\Android\LayoutViewGroup.cs:line 82
[mono-rt]    at Android.Views.View.n_OnMeasure_II(IntPtr jnienv, IntPtr native__this, Int32 widthMeasureSpec, Int32 heightMeasureSpec) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 19598
[mono-rt]    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPII_V(_JniMarshal_PPII_V callback, IntPtr jnienv, IntPtr klazz, Int32 p0, Int32 p1) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 154
[mono-rt]    at Java.Interop.JniEnvironment.StaticMethods.CallStaticLongMethod(JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 21700
[mono-rt]    at Java.Interop.JniPeerMembers.JniStaticMethods.InvokeInt64Method(String encodedMember, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:line 147
[mono-rt]    at Microsoft.Maui.PlatformInterop.MeasureAndGetWidthAndHeight(View view, Int32 widthMeasureSpec, Int32 heightMeasureSpec) in D:\a\_work\1\s\artifacts\obj\Core\Release
et8.0-android\generated\src\Microsoft.Maui.PlatformInterop.cs:line 580
[mono-rt]    at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Handlers\ViewHandlerExtensions.Android.cs:line 93
[mono-rt]    at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.LayoutViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetDesiredSize(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.Android.cs:line 18
[mono-rt]    at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Layouts\LayoutExtensions.cs:line 27
[mono-rt]    at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Controls\src\Core\VisualElement\VisualElement.cs:line 1893
[mono-rt]    at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Measure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Controls\src\Core\VisualElement\VisualElement.cs:line 1880
[mono-rt]    at Microsoft.Maui.Layouts.LayoutExtensions.MeasureContent(IContentView contentView, Thickness inset, Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Layouts\LayoutExtensions.cs:line 163
[mono-rt]    at Microsoft.Maui.Layouts.LayoutExtensions.MeasureContent(IContentView contentView, Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Layouts\LayoutExtensions.cs:line 142
[mono-rt]    at Microsoft.Maui.Controls.ContentPage.Microsoft.Maui.ICrossPlatformLayout.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Controls\src\Core\ContentPage\ContentPage.cs:line 85
[mono-rt]    at Microsoft.Maui.Platform.ContentViewGroup.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint) in D:\a\_work\1\s\src\Core\src\Platform\Android\ContentViewGroup.cs:line 51
[mono-rt]    at Microsoft.Maui.Platform.ContentViewGroup.OnMeasure(Int32 widthMeasureSpec, Int32 heightMeasureSpec) in D:\a\_work\1\s\src\Core\src\Platform\Android\ContentViewGroup.cs:line 73
[mono-rt]    at Android.Views.View.n_OnMeasure_II(IntPtr jnienv, IntPtr native__this, Int32 widthMeasureSpec, Int32 heightMeasureSpec) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 19598
[mono-rt]    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPII_V(_JniMarshal_PPII_V callback, IntPtr jnienv, IntPtr klazz, Int32 p0, Int32 p1) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 154
[mono-rt]    at Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod(JniObjectReference instance, JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 20825
[mono-rt]    at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeNonvirtualVoidMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 93
[mono-rt]    at Android.Views.View.Measure(Int32 widthMeasureSpec, Int32 heightMeasureSpec) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 18377
[mono-rt]    at Microsoft.Maui.Controls.Platform.Compatibility.ShellPageContainer.OnMeasure(Int32 widthMeasureSpec, Int32 heightMeasureSpec) in D:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\Android\ShellPageContainer.cs:line 54
[mono-rt]    at Android.Views.View.n_OnMeasure_II(IntPtr jnienv, IntPtr native__this, Int32 widthMeasureSpec, Int32 heightMeasureSpec) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 19598
[mono-rt]    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPII_V(_JniMarshal_PPII_V callback, IntPtr jnienv, IntPtr klazz, Int32 p0, Int32 p1) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 154

Platforms

  • Android
  • iOS

Basic Information

  • Visual Studio 17.10.1
  • AiForms.SettingsView 1.0.10
  • MAUI 8.0.21
  • Android Support Library Version: 13.2.2.0
  • Affected Devices:

Screenshots

Reproduction Link

Workaround

@Jakar510
Copy link
Author

Jakar510 commented Jun 6, 2024

iOS is untested

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

1 participant