-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building net*-android apps always restore Microsoft.NETCore.App.Host.linux #25679
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Context: 3f052b5 Context: dotnet/sdk#25679 If you use our .NET 7 workload, and do: dotnet new android dotnet restore It fails with: C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-x64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] You have to add a `nuget.config` to solve the issue: <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" /> </packageSources> </configuration> In 3f052b5, we had a workaround for early .NET 6 previews to prevent this issue. At some point the problem *seemed* fixed because the dotnet/runtime we were using was always on NuGet.org. I tested a .NET 6 Android app with the 6.0.300 SDK, and it always downloads these packages. For now, let's put 3f052b5 back in. This should also allow us to remove the `dotnet7` feed in our MSBuild tests.
Context: 3f052b5 Context: dotnet/sdk#25679 If you use our .NET 7 workload, and do: dotnet new android dotnet restore It fails with: C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-x64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] You have to add a `nuget.config` to solve the issue: <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" /> </packageSources> </configuration> In 3f052b5, we had a workaround for early .NET 6 previews to prevent this issue. At some point the problem *seemed* fixed because the dotnet/runtime we were using was always on NuGet.org. I tested a .NET 6 Android app with the 6.0.300 SDK, and it always downloads these packages. For now, let's put 3f052b5 back in. This should also allow us to remove the `dotnet7` feed in our MSBuild tests.
Context: 3f052b5 Context: dotnet/sdk#25679 If you use our .NET 7 workload, and do: dotnet new android dotnet restore It fails with: C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-x64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] You have to add a `nuget.config` to solve the issue: <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" /> </packageSources> </configuration> In 3f052b5, we had a workaround for early .NET 6 previews to prevent this issue. At some point the problem *seemed* fixed because the dotnet/runtime we were using was always on NuGet.org. I tested a .NET 6 Android app with the 6.0.300 SDK, and it always downloads these packages. For now, let's put 3f052b5 back in. This should also allow us to remove the `dotnet7` feed in our MSBuild tests.
@dsplaisted I believe you were looking into this before with Jonathan. |
We had a new version of this appear in: dotnet/android#7071
|
@jonathanpeppers does setting DisableTransitiveFrameworkReferenceDownloads per #25358 work around this issue now or is it separate? |
Trying /p:DisableTransitiveFrameworkReferenceDownloads=true out locally, does not seem to fix the problem when building Maui targeting android-arm64. |
I think there might be a couple different things going on here:
@directhex was going to look at the RIDs and/or the packages. Did we come up with something there? Maybe we should delete the 32-bit ones that shouldn't exist? |
The bug here is the needless restore. The existence or lack thereof of a runtime pack for linux-bionic-x86 should not be affecting Android apps. We need to figure out why that dependency is being considered as needed by the SDK. |
I am not super familiar with how the SDK uses the RID Graph, although it looks like linux-bionic* are included as imports for the respective RID's based on the RuntimeIdentifierGraph.json file used when building the Maui app:
Are these imports not treated as download/install requirements? Or is there a different place I should be looking to track down this bug? Looking at dotnet/runtime@b5f9c22#diff-4cae40f80b790c66e01955edbd41e3ea51cec84088d1cbf6b461a5be8daee777R279-R307, it looks like android was previously importing linux, would changing it back to that fix the issue? Thanks! |
The RID graph should only be traversed like that when it comes to calculating NuGet fallbacks - i.e. "if there's no .so for android in this package, try the .so for linux-bionic, followed by the .so for Linux" |
@dsplaisted pointed to #22658 where we can exclude certain rids from the task that tries to download hosting packs. |
Context: 3f052b5 Context: dotnet/sdk#25679 If you use our .NET 7 workload, and do: dotnet new android dotnet restore It fails with: C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-x64 with version (= 7.0.0-preview.5.22271.4) - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ] - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj] You have to add a `nuget.config` to solve the issue: <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" /> </packageSources> </configuration> In 3f052b5, we had a workaround for early .NET 6 previews to prevent this issue. At some point the problem *seemed* fixed because the dotnet/runtime we were using was always on NuGet.org. I tested a .NET 6 Android app with the 6.0.300 SDK, and it always downloads these packages. For now, let's put 3f052b5 back in. This should also allow us to remove the `dotnet7` feed in our MSBuild tests.
Change went into installer for 6.0.400 already and flowing to main here: dotnet/installer#14288 |
I have this issue newly on my m1 macbook after sdk 6.0.400 update. .NET SDK (reflecting any global.json): Runtime Environment: global.json file: Host:
|
These are on NuGet.org: https://www.nuget.org/packages/Microsoft.NETCore.App.Host.linux-arm/6.0.8 They shipped yesterday, I think, so maybe it just works now? |
No change I also tried this: dotnet add package Microsoft.NETCore.App.Host.linux-arm --version 6.0.8 and here is what i got:
|
This workaround is missing in 6.0.400 release: |
Describe the bug
Appears to always download:
This is related to: #19891
Since these are on NuGet.org, everything works.
However, we started noticing this with
net7.0-android
apps:Since these are not on NuGet, you get errors like:
And so anyone dogfooding .NET 7 would have to add a
nuget.config
:To Reproduce
dotnet new android
dotnet restore
Exceptions (if any)
Binlog: msbuild.zip
Further technical details
The text was updated successfully, but these errors were encountered: