Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Bug] Launcher in iOS - UTI exception when trying to open file #1877

@tilemmpon

Description

@tilemmpon

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:

await Launcher.OpenAsync(new OpenFileRequest
{
    File = new ReadOnlyFile(file)
});

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:

var id = UTType.CreatePreferredIdentifier(UTType.TagClassFilenameExtension, extension, null);

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

  1. Run the iOS Sample for Xamarin Essentials
  2. Select the Launcher option
  3. Give a filename and file contents and click "Open File"

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

  • Version with issue:
    • Xamarin Essentials: 1.6.1 and 1.7.0
    • Windows 10 PC
    • MacOS Big Sur Version 11.5.2
      • Mac Mono Framework MDK. Runtime: Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit) Package version: 612000140
  • Last known good version: N/A
  • IDE: Microsoft Visual Studio 2019 Version 16.11.1
    • Xamarin: 16.11.000.174 (d16-11@e8f56f1)
    • Xamarin.iOS and Xamarin.Mac SDK: 14.20.0.25 (3b53e529b)
  • Platform Target Frameworks:
    • iOS: 8.0 and 10.0
  • Nuget Packages:
    • Xamarin Forms: 5.0.0.2012 and 5.0.0.2083
    • Xamarin Essentials: 1.6.1 and 1.7.0
  • Affected Devices:
    • Tested with iPhone 12 Simulator with iOS 14.5

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions