xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.52k stars 506 forks source link

[Bug] App crashes on ios simulator when using PhoneDialer.Open() even though exception handling is present #1652

Closed themronion closed 2 years ago

themronion commented 3 years ago

Steps to Reproduce

I am aware the apple didnt implement phone calls and sms on their simulator but i dont understand why this code still crashes. The exception is being thrown and it must be catched in the catch block. Maybe there is something else going on there (maybe that has something to do with Hot Reload)? Give it a look please, maybe it is a bug?

try
{ 
     PhoneDialer.Open("yourphone");
}
catch (Exception ex)
{
     Console.WriteLine($"Exception while opening dialer: {ex.Message}");
}

Even though try catch is present is the code the app will crash with the fllowing stack trace:

2021-01-24 14:27:20.995519+0200 MobilAutoNew.iOS[24092:144521] -canOpenURL: failed for URL: "tel:0000000000" - error: "This app is not allowed to query for scheme tel"
**Xamarin.Essentials.FeatureNotSupportedException:** 'Specified method is not supported.'

[HotReload] (2021-01-24 14:27:23.5): ERROR: Caught exception in AgentStatusChangedHandler at 215: Xamarin.HotReload.UnhandledDeviceException: Specified method is not supported.
   в Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   в Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
[HotReload] (2021-01-24 14:27:23.5): ERROR: Specified method is not supported.
    at Xamarin.Essentials.PhoneDialer.ValidateOpen (System.String number) [0x0001a] in D:\a\1\s\Xamarin.Essentials\PhoneDialer\PhoneDialer.shared.cs:13
    at Xamarin.Essentials.PhoneDialer.PlatformOpen (System.String number) [0x0000a] in D:\a\1\s\Xamarin.Essentials\PhoneDialer\PhoneDialer.ios.cs:16
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
    at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/Foundation/NSAction.cs:178
    at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) in :0
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:86
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:65
    at MobilAutoNew.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\pavlo\source\repos\MobilAutoNew\MobilAutoNew.iOS\Main.cs:17
[HotReload] (2021-01-24 14:27:23.5): INFO: Не удалось запустить Горячую перезагрузку XAML. Если проблема сохраняется, выберите "Справка" -> "Сообщить о проблеме".
[HotReload] (2021-01-24 14:27:23.5): INFO: Stopping All Hot Reload sessions due to Failed ...
[HotReload] (2021-01-24 14:27:23.5): INFO: (MobilAutoNew.iOS) Stopped Hot Reload session due to Failed ...
[HotReload] (2021-01-24 14:27:23.5): INFO: Stopped Hot Reload session.
[HotReload] (2021-01-24 14:27:23.5): ERROR: (MobilAutoNew.iOS) Caught exception in Debugger_TargetUnhandledException at 208: Xamarin.HotReload.UnhandledDeviceException: Specified method is not supported.

Thread finished: <Thread Pool> #8
Поток 0x8 завершился с кодом 0 (0x0).
Thread started: <Thread Pool> #17
2021-01-24 14:27:22.647329+0200 MobilAutoNew.iOS[24092:144521] 
Unhandled Exception:
Xamarin.Essentials.FeatureNotSupportedException: Specified method is not supported.
  at Xamarin.Essentials.PhoneDialer.ValidateOpen (System.String number) [0x0001a] in D:\a\1\s\Xamarin.Essentials\PhoneDialer\PhoneDialer.shared.cs:13 
  at Xamarin.Essentials.PhoneDialer.PlatformOpen (System.String number) [0x0000a] in D:\a\1\s\Xamarin.Essentials\PhoneDialer\PhoneDialer.ios.cs:16 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021 
  at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/Foundation/NSAction.cs:178 
--- End of stack trace from previous location where exception was thrown ---

  at (w
rapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at MobilAutoNew.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\pavlo\source\repos\MobilAutoNew\MobilAutoNew.iOS\Main.cs:17
2021-01-24 14:27:22.649358+0200 MobilAutoNew.iOS[24092:144521] Unhandled managed exception: Specified method is not supported. (Xamarin.Essentials.FeatureNotSupportedException)
  at Xamarin.Essentials.PhoneDialer.ValidateOpen (System.String number) [0x0001a] in D:\a\1\s\Xamarin.Essentials\PhoneDialer\PhoneDialer.shared.cs:13 
  at Xamarin.Essentials.PhoneDialer.PlatformOpen (System.String number) [0x0000a] in D:\a\1\s\Xamarin.Essentials\PhoneDialer\PhoneDialer.ios.cs:16 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021 
  at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/Foundation/NSAction.cs:178 
--- End of stack trace from previous location where exception was thrown ---

  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.6.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at MobilAutoNew.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\pavlo\source\repos\MobilAutoNew\MobilAutoNew.iOS\Main.cs:17

=================================================================
    Native Crash Reporting
=================================================================
Got a abrt while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Native stacktrace:
=================================================================
    0x108b94535 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_dump_native_crash_info
    0x108b889be - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_handle_native_crash
    0x108b93b4f - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : sigabrt_signal_handler
    0x7fff60c815fd - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_platform.dylib : _sigtramp
    0x7fb55960de00 - Unknown
    0x7fff200fab94 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib : abort
    0x108dd7ddf - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : xamarin_unhandled_exception_handler
    0x108c4a955 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_invoke_unhandled_exception_hook
    0x108b883ca - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_handle_exception_internal
    0x108b86879 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_handle_exception
    0x108b06f09 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_amd64_throw_exception
    0x10c0ad5b0 - Unknown
    0x108dd7b2b - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : xamarin_process_managed_exception
    0x108a719af - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : _ZL31native_to_managed_trampoline_36P11objc_objectP13objc_selectorPP11_MonoMethodj
    0x108a7758c - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : -[__MonoMac_NSAsyncSynchronizationContextDispatcher xamarinApplySelector]
    0x7fff208582ba - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation : __NSThreadPerformPerform
    0x7fff2038f38a - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
    0x7fff2038f282 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopDoSource0
    0x7fff2038e764 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopDoSources0
    0x7fff20388f2f - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopRun
    0x7fff203886d6 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
    0x7fff2bededb3 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Private
Frameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
    0x7fff24690e0b - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIApplication _run]
    0x7fff24695cbc - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
    0x110ff9955 - Unknown
    0x110decde3 - Unknown
    0x10f937123 - Unknown
    0x108b9ec71 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_jit_runtime_invoke
    0x108cc5148 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_runtime_invoke_checked
    0x108ccb4b5 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_runtime_exec_main_checked
    0x108afda8c - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : mono_jit_exec
    0x108dea31d - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : xamarin_main
    0x108ab7df7 - /Users/mr.onion/Library/Developer/CoreSimulator/Devices/E1FBE390-5D4B-4907-A100-443F28C66670/data/Containers/Bundle/Application/F446707B-2C5D-4A02-80C0-AA4301A9D582/MobilAutoNew.iOS.app/MobilAutoNew.iOS : main
    0x7fff202593e9 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib : start

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x7fff60c5833a):0x7fff60c5832a  ff ff c3 90 90 90 b8 48 01 00 02 49 89 ca 0f 05  .......H...I....

0x7fff60c5833a  73 08 48 89 c7 e9 e5 a2 ff ff c3 90 90 90 b8 53  s.H............S
0x7fff60c5834a  00 00 02 49 89 ca 0f 05 73 08 48 89 c7 e9 cd a2  ...I....s.H.....
0x7fff60c5835a  ff ff c3 90 90 90 b8 83 01 00 02 49 89 ca 0f 05  ...........I....

=================================================================
    Managed Stacktrace:
=================================================================
=================================================================
jamesmontemagno commented 3 years ago

Hmmm it shouldn't crash like this, which is interesting, but the simulator doesn't have a Dialer so that API is not allowed to be called and this could cause a catastrophic failure, which is out of our control and is iOS itself crashing your app.

You can check the DeviceInfo.DeviceType to see if it is a simulator or not and only do it on a physical device.

themronion commented 3 years ago

@jamesmontemagno it is a simulator, yes. Well, if it is out of your control then ok. I just thought that this is indeed a strange behaviour because the exception is not being caught. You can close the issue if it is not a concern for the library)

jamesmontemagno commented 3 years ago

I need to look at it a bit closer to see if we can handle it more gracefully :)

SailorTurkey commented 3 years ago

@jamesmontemagno I am pretty sure Essentials does check if dialing is available, because exception is thrown by Essentials not IOS: Xamarin.Essentials.FeatureNotSupportedException: Specified method is not supported.

May be Essentials should introduce a property / method, so instead of try/catch ing we can also precheck the condition? Something like the following, it should be trivial to implement, PhoneDialer library already has an internal IsSupported property. making it public can solve this problem, what do you think?

https://github.com/xamarin/Essentials/blob/0dba844e8085f7cb36d62115b005620d541e0fbd/Xamarin.Essentials/PhoneDialer/PhoneDialer.shared.cs#L12-L13

https://github.com/xamarin/Essentials/blob/878d2bef9a5eabb4c323071676b58ae3032ef0f5/Xamarin.Essentials/PhoneDialer/PhoneDialer.ios.cs#L12

https://github.com/xamarin/Essentials/blob/add928f57b47c1b59beab2447a5cf224add75b50/Xamarin.Essentials/PhoneDialer/PhoneDialer.android.cs#L15-L22

                    if(PhoneDialer.IsSupported)
                        PhoneDialer.Open(phone);
Silic0nS0ldier commented 3 years ago

There is a flaw in the iOS specific code which is causing these exceptions to go uncaught. That is, PhoneDialer.Open calls the platform specific method PhoneDialer.PlatformOpen which for iOS is marked as async (and critically is not awaited). This change was introduced in https://github.com/xamarin/Essentials/pull/1542

In theory, this issue could result in crashes on real iOS devices.

Reverting the changes made to PhoneDialer on iOS would fix this. I think it would also be worthwhile creating some automated tests to guard against these kinds of regressions in the future (I could have missed something, but none seem to exist that covers platform specific code).

jamesmontemagno commented 3 years ago

Good research here @Silic0nS0ldier <3

I am fine with moving it back to UIApplication.SharedApplication.OpenUrl(nsUrl); @mattleibow thoughts?

sunkerGit commented 3 years ago

public static bool TryCallContact(string contactNumber) { if (DeviceInfo.DeviceType == DeviceType.Physical) { PhoneDialer.Open(contactNumber); return true; } else { return false; } }

this will resolve the crash problem, the current problem has come from the emulator whereas the PhoneDialer method was crashed on an emulator, not the physical devices.

pgilhuijs commented 3 years ago

On physical device it crashes also

Silic0nS0ldier commented 3 years ago

Yep, as I said before the implementation is an async method. While the iOS simulator will crash, a physical iOS device could also crash (e.g. iPad and iPod Touch may not have a provider for calling functionality, iPhone may have an internal error, iOS rejects the API call citing in response to some newly added permission requirement, etc).

Regardless a potential solution has been identified (reverting some changes), someone just has to have a go at implementing it. (and presumably approval from Xamarin Essentials code owners)

chillNZ commented 3 years ago

I've ran into this bug also after upgrading and can confirm the behaviour Silic0nS0ldier reported above.Also note the official documentation example shows catch blocks being used which won't actually work on ios (the catch blocks never catch the exception and the whole app crashes, which is contrary to the implication in the example) - not sure if this needs to be updated or not: https://docs.microsoft.com/en-us/xamarin/essentials/phone-dialer?tabs=ios.

maxchu92 commented 3 years ago

I am having the same issue as well. I tried catching the exception but it threw it in the Application class. I made sure my async await is correct. image

image

sbalkhair commented 3 years ago

I am having the same issue as well. I tried catching the exception but it threw it in the Application class. I made sure my async await is correct. image

image

same issue

mackayn commented 2 years ago

Seeing the same :(

You can use the launcher though

var canLaunch = await _launcher.CanOpenAsync(SupportNumber);
                if (canLaunch)
                {
                    await _launcher.OpenAsync(SupportNumber);
angelru commented 2 years ago

How do we solve it? same issue

benlings commented 2 years ago

I'm seeing the same crash. Looks like this is because PhoneDialer.PlatformOpen is async void and not awaited when its called, so the exceptions thrown in ValidateOpen aren't passed back to the caller. I think the fix would be to remove the async from the method definition and the await from the last line of the function. https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/PhoneDialer/PhoneDialer.ios.cs#L14-L20

TonyLugg commented 2 years ago

Any sign of a fix for this? I'm using Essentials 1.7.1 and it is still crashing.

trevoriancox commented 2 years ago

Another test case to reproduce this on a simulator or real iOS device:

PhoneDialer.Open("5555551212#hash");

It will throw FeatureNotSupportedException in a different thread.

jfversluis commented 2 years ago

Confirmed that @benlings solution surfaces the exception