You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 15, 2024. It is now read-only.
{System.Exception: Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000a8] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:504
at Foundation.NSUrl..ctor (System.String urlString) [0x00023] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSUrl.g.cs:139
at Xamarin.Essentials.Launcher.PlatformOpenAsync (System.Uri uri) [0x0000b] in :0
at Xamarin.Essentials.Launcher.OpenAsync (System.String uri) [0x00019] in :0
at LauncherIssue.MainPage.LaunchApplicationAsync (System.String uri) [0x00018] in /Users/rakeshrnair/Projects/LauncherIssue/LauncherIssue/MainPage.xaml.cs:30 }
Launcher.OpenAsync(uri); method call crashes / throws an exception in case any space in the query url.
The issue is only present in iOS. Android everything working as expected.
My button click event
Launcher call
Stack Trace.
{System.Exception: Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000a8] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:504
at Foundation.NSUrl..ctor (System.String urlString) [0x00023] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSUrl.g.cs:139
at Xamarin.Essentials.Launcher.PlatformOpenAsync (System.Uri uri) [0x0000b] in :0
at Xamarin.Essentials.Launcher.OpenAsync (System.String uri) [0x00019] in :0
at LauncherIssue.MainPage.LaunchApplicationAsync (System.String uri) [0x00018] in /Users/rakeshrnair/Projects/LauncherIssue/LauncherIssue/MainPage.xaml.cs:30 }
I can reproduce the issue in all iOS devices.