Skip to content

[Android] Json files not being read #16430

Closed

Description

@erikvilima

Current behavior

When trying to do var products = await _dataService.ReadPackageFileAsync("products.json");

If we don't add a <Content Include="products.json" /> the json file is not read on Adroid.

And if we keep the <Content Include="products.json" /> we get an error on Desktop and WASM:

1>C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.Shared.targets(213,5): error NETSDK1022: Duplicate 'Content' items were included. The .NET SDK includes 'Content' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultContentItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'products.json'

Expected behavior

No response

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

Open this repro UnoApp3.zip
On the csproj file comment out the line <Content Include="products.json" />
Add a breakpoint on ProductsEndpoint.cs line 19
Run the app on Android

On the csproj file uncomment the line <Content Include="products.json" />
Run the app on Android

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

Uno.SDK = 5.2.83

<UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
<UnoThemesVersion>5.0.13</UnoThemesVersion>
<UnoCSharpMarkupVersion>5.2.13</UnoCSharpMarkupVersion>

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    kind/bug
    triage/untriaged
    difficulty/tbd
    on Apr 23, 2024
  2. added
    platform/android 🤖
    area/sdk
    on Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/sdkdifficulty/tbdkind/bugplatform/android 🤖triage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions