rotorgames / Rg.Plugins.Popup

Xamarin Forms popup plugin
MIT License
1.15k stars 337 forks source link

Android ArgumentNullException was throw: Value cannot be null. Parameter name: obj #715

Closed FabriBertani closed 2 years ago

FabriBertani commented 2 years ago

πŸ› Bug Report

Hi, in Xamarin.Forms v5.0.0.2196 the plugin throw an ArgumentException in Android while trying to open a popup. Currently using Rg.Plugins.Popup v2.0.0.14. I must clarify that works fine on iOS and UWP and i'm running the same plugin version in another project but with XF v.5.0.0.2012 and there it works fine too, but I cannot downgrade XF version on this project.

This is the stacktrace:

at Xamarin.Forms.Internals.Registrar`1[TRegistrable].GetHandlerForObject[TOut] (System.Object obj, System.Object[] args) [0x00003] in D:\a\1\s\Xamarin.Forms.Core\Registrar.cs:117 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:354 
  at Xamarin.Forms.Platform.Android.Platform.CreateRendererWithContext (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:366 
  at Rg.Plugins.Popup.Droid.Extensions.PlatformExtension.GetOrCreateRenderer (Xamarin.Forms.VisualElement bindable) [0x0000a] in /Users/kirilllyubimov/Projects/Xamarin/Rg.Plugins.Popup/Rg.Plugins.Popup/Platforms/Android/Extensions/PlatformExtension.cs:14 
  at Rg.Plugins.Popup.Droid.Impl.PopupPlatformDroid.<AddAsync>g__HandleAccessibilityWorkaround|9_0 (Rg.Plugins.Popup.Pages.PopupPage page) [0x0005d] in /Users/kirilllyubimov/Projects/Xamarin/Rg.Plugins.Popup/Rg.Plugins.Popup/Platforms/Android/Impl/PopupPlatformDroid.cs:61 
  at Rg.Plugins.Popup.Droid.Impl.PopupPlatformDroid.AddAsync (Rg.Plugins.Popup.Pages.PopupPage page) [0x00006] in /Users/kirilllyubimov/Projects/Xamarin/Rg.Plugins.Popup/Rg.Plugins.Popup/Platforms/Android/Impl/PopupPlatformDroid.cs:43 
  at Rg.Plugins.Popup.Services.PopupNavigationImpl.AddAsync (Rg.Plugins.Popup.Pages.PopupPage page) [0x00000] in /Users/kirilllyubimov/Projects/Xamarin/Rg.Plugins.Popup/Rg.Plugins.Popup/Services/PopupNavigationImpl.cs:177 
  at Rg.Plugins.Popup.Services.PopupNavigationImpl+<>c__DisplayClass20_0.<PushAsync>b__0 () [0x00047] in /Users/kirilllyubimov/Projects/Xamarin/Rg.Plugins.Popup/Rg.Plugins.Popup/Services/PopupNavigationImpl.cs:76 
  at Rg.Plugins.Popup.Services.PopupNavigationImpl+<>c__DisplayClass28_0.<InvokeThreadSafe>b__0 () [0x00025] in /Users/kirilllyubimov/Projects/Xamarin/Rg.Plugins.Popup/Rg.Plugins.Popup/Services/PopupNavigationImpl.cs:212 

image

Expected behavior

To open correctly the popup on Android.

Reproduction steps

  1. Create a popup page.
  2. Navigate to the popup via await PopupNavigation.Instance.PushAsync(new TestPopupPage()); (also I've tried wrap the navigation in MainThread).
  3. Exception is throw.

Configuration

Rg.Plugins.Popup Version: 2.0.0.14 Xamarin.Forms Version: 5.0.0.2196 AndroidX Target Version: 11

Platform:

FabriBertani commented 2 years ago

Please ignore this issue, I found out that the issue was caused by the property AndroidTalkbackAccessibilityWorkaround that was set to true on the xaml part of the popup.

LuckyDucko commented 2 years ago

Hey @FabriBertani this is good to know however, the android accessibility i was always worried would cause an issue.

I'll try and figure out latest xamarin changes