Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend.XF.Android: fix NRE when scanning QR codes
This commit adds the missing Xamarin.Essential init call that was causing the ZXing.Net to crash. This regression was introduced by this commmit: [1] which updated ZXing.Net.Xamarin from 0.10.x to 2.9.99, which seems to introduce Xamarin.Essentials as dependency and needs initializing on Android, as evidenced by: [2] [1] https://gitlab.com/nblockchain/geewallet/-/commit/9e313fac173bc9d9eab19b90970cbea199dfb6b2 [2] Redth/ZXing.Net.Mobile@5ddfa0e Stacktrace: System.NullReferenceException: The current Activity can not be detected. Ensure that you have called Init in your Activity or Application class. at Xamarin.Essentials.Platform.GetCurrentActivity (System.Boolean throwOnNull) [0x00018] in D:\a\DotNetEssentials\DotNetEssentials\Xamarin.Essentials\Platform\Platform.android.cs:80 at Xamarin.Essentials.Permissions+BasePlatformPermission.RequestAsync () [0x00208] in D:\a\DotNetEssentials\DotNetEssentials\Xamarin.Essentials\Permissions\Permissions.android.cs:118 at ZXing.Net.Mobile.Forms.Android.ZXingScannerViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x0005d] in D:\a\ZXing.Net.Xamarin\ZXing.Net.Xamarin\ZXing.Net.Mobile.Forms\ZXingScannerViewRenderer.android.cs:59 at GWallet.Backend.Infrastructure.Report (System.Exception ex, SharpRaven.Data.ErrorLevel _arg1) [0x00017] in C:\geewallet\src\GWallet.Backend\Infrastructure.fs:131 at GWallet.Backend.Infrastructure.LogOrReportCrash (System.Exception ex) [0x00000] in C:\geewallet\src\GWallet.Backend\Infrastructure.fs:150 at GWallet.Backend.Infrastructure.OnUnhandledException (System.Object _arg1, System.UnhandledExceptionEventArgs args) [0x0000c] in C:\geewallet\src\GWallet.Backend\Infrastructure.fs:162 at [email protected] (System.Object delegateArg0, System.UnhandledExceptionEventArgs delegateArg1) <0x783f80cdf8 + 0x00043> in <94e6baede217a6cfa3c49f143dcc2e81>:0 See https://gitlab.com/nblockchain/geewallet/-/merge_requests/143
- Loading branch information