Open tilemmpon opened 3 years ago
To further update on this issue, this seems to be an error when running on iOS Simulator on Mac Silicon. With a real device it works without any crash (*). For the simulator I found the following workaround if someone has the same issue and wants to test the launcher on Mac Silicon:
Use the package to detect the mine type and input it in the launcher, like this:
var mime = MimeTypes.GetMimeType(<filePath>);
await Launcher.OpenAsync(new OpenFileRequest
{
File = new ReadOnlyFile(<filePath>, mime)
});
(*) although we still have the issue reported in https://github.com/xamarin/Essentials/issues/1376 which is supposedly fixed
Description
When trying to open any file with Xamarin Essentials Launcher in iOS I receive the error "System.ArgumentNullException: 'Value cannot be null. Parameter name: uti' ". I attach relative screenshot. The code I am using is as per documentation:
And the error appears in my application, in an empty new application with only this code, and also when running the Xamarin Essentials Samples. The Android version works fine. I have tracked the error down to this line:
https://github.com/xamarin/Essentials/blob/7218ab88f7fbe00ec3379bd54e6c0ce35ffc0c22/Xamarin.Essentials/FileSystem/FileSystem.ios.tvos.watchos.macos.cs#L56
where the "conformingToUti" string parameter is passed as null.
Verification that this error can be reproduced by other users as well is needed.
Steps to Reproduce
Expected Behavior
The file should open with default app or shown as preview.
Actual Behavior
The application throws an exception ("System.ArgumentNullException: 'Value cannot be null. Parameter name: uti' ").
Basic Information
Screenshots