android: [net8-pre5] Build app for android-arm fails with error NU1101: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-arm

Android application type

.NET Android (net7.0-android, etc.)

Affected platform version

net8-pre5

Description

Building my app for android-arm, it fails with the following error:

error NU1101: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-arm. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Local, Microsoft Visual Studio Offline Packages, nuget.org

Steps to Reproduce

Check the attached binlog msbuild.zip

Did you find any workaround?

No response

Relevant log output

No response

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 2
  • Comments: 24 (11 by maintainers)

Most upvoted comments

Workaround: add this to csproj:

  <Target Name="_RemoveLinuxFrameworkReferences"
      AfterTargets="ProcessFrameworkReferences">
    <ItemGroup>
      <_ProblematicRIDs Include="linux-bionic-arm;linux-bionic-arm64;linux-bionic-x86;linux-bionic-arm64" />
      <PackageDownload Remove="Microsoft.NETCore.App.Runtime.%(_ProblematicRIDs.Identity)" />
    </ItemGroup>
  </Target>

Here’s a simple repro:

$ dotnet new classlib -o myLib
$ cd myLib
$ dotnet restore -r android-arm
  Determining projects to restore...
/Users/alexander/dev/test/8170/myLib/myLib.csproj : error NU1101: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-arm. No packages exist with this id in source(s): /usr/local/share/dotnet/library-packs, nuget.org
  Failed to restore /Users/alexander/dev/test/8170/myLib/myLib.csproj (in 514 ms).

The reason why it’s using linux-bionic-arm is because the RID graph specifies it as a parent of android-arm. Not sure if the RID flowing to the library project in the original issue project is expected, @dsplaisted ?