Skip to content

Android GetFileFromApplicationUriAsync doesn't work #8618

@pkar70

Description

@pkar70

Current behavior

Exception **Java.IO.FileNotFoundException:** is thrown.

Expected behavior

File should be 'openable'.

How to reproduce it (as minimally and precisely as possible)

            Uri oPicUri = new Uri("ms-appx:///Assets/1950.gif");
            Windows.Storage.StorageFile oFile;
            try
            {  
                oFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(oPicUri);
            }
            catch
            {
                return false;
            }

Exception: **Java.IO.FileNotFoundException:** 'Assets/__1950.gif'

Part of: https://github.com/pkar70/KrakTram

GIF files are present, e.g. X\KrakTram\KrakTram_Uno\KrakTram_Uno.Shared\Assets\1950.gif
On build, they are copied to X\KrakTram\KrakTram_Uno\KrakTram_Uno.Droid\obj\Debug\120\res\drawable-nodpi__1950.gif

Workaround

None known.

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

UnoUI 4.2.6

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

17.0.5

Relevant plugins

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't workingtriage/needs-informationIndicates an issue needs more information in order to work on it.triage/untriagedIndicates an issue requires triaging or verification

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions