Skip to content
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

Empty MAUI project does not compile: dotnet workload install and restore for android workload fail in microsoft.android.sdk.windows.msi.x64::33.0.80 is not found in NuGet feeds https://api.nuget.org/v3/index.json #16657

Closed
TommiGustafsson-HMP opened this issue Aug 10, 2023 · 5 comments
Labels
platform/android 🤖 s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@TommiGustafsson-HMP
Copy link
Contributor

TommiGustafsson-HMP commented Aug 10, 2023

Description

I'm trying to compile an empty MAUI project for Android. If I try to build the project in Visual Studio 2022, I get this error:

NETSDK1147	To build this project, the following workloads must be installed: android
To install these workloads, run the following command: dotnet workload restore	MauiApp1b	C:\Program Files\dotnet\sdk\7.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets	38	

It tells me to do dotnet workload restore but it ends in an error:

Downloading Microsoft.Android.Sdk.Windows.Msi.x64 (33.0.80)
Workload installation failed. Rolling back installed packs...
Downloading microsoft.net.workload.emscripten.net7.manifest-7.0.100.msi.x64 (7.0.10)
Downloading microsoft.net.workload.emscripten.net6.manifest-7.0.100.msi.x64 (7.0.10)
Downloading microsoft.net.workload.mono.toolchain.net7.manifest-7.0.100.msi.x64 (7.0.10)
Downloading microsoft.net.workload.mono.toolchain.net6.manifest-7.0.100.msi.x64 (7.0.10)
Workload installation failed: One or more errors occurred. (microsoft.android.sdk.windows.msi.x64::33.0.80 is not found in NuGet feeds https://api.nuget.org/v3/index.json".)

There's no Microsoft.Android.Sdk.Windows.Msi.x64 33.0.80 in NuGet.

This happens with dotnet workload restore, dotnet workload install android and dotnet workload install maui.

dotnet workload uninstall android says: "Workload uninstallation failed: Couldn't find workload ID(s): android"

dotnet workload list gives:

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
maui-windows               7.0.92/7.0.100         VS 17.7.34003.232
maui-maccatalyst           7.0.92/7.0.100         VS 17.7.34003.232
maccatalyst                16.4.7090/7.0.100      VS 17.7.34003.232
maui-ios                   7.0.92/7.0.100         VS 17.7.34003.232
ios                        16.4.7090/7.0.100      VS 17.7.34003.232
maui-android               7.0.92/7.0.100         VS 17.7.34003.232
android                    33.0.80/7.0.100        VS 17.7.34003.232

Android seems to be at 33.0.80!

dotnet workload update ends in an error:

Removing Microsoft.Android.Ref.31.32.0.476-x64.msi ..... Failed
Warning: Workload garbage collection failed with error: Failed to remove Microsoft.Android.Ref.31.32.0.476-x64.msi. Error: 0x00000643. Fatal error during installation..

I am unable to compile an empty MAUI project for Android. Other platforms seem to work, at least Windows.

I have a fresh Visual Studio 2022 17.7.0 installation. I have tried reinstalling but it did not help.

Steps to Reproduce

  1. Create a new MAUI app.
  2. Try to build it for android, says: "To build this project, the following workloads must be installed: android
    To install these workloads, run the following command: dotnet workload restore"
  3. Try dotnet workload restore, says: Workload installation failed: One or more errors occurred. (microsoft.android.sdk.windows.msi.x64::33.0.80 is not found in NuGet feeds https://api.nuget.org/v3/index.json

Link to public reproduction project repository

No response

Version with bug

7.0.92

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

@TommiGustafsson-HMP TommiGustafsson-HMP added the t/bug Something isn't working label Aug 10, 2023
@mattleibow
Copy link
Member

Can you try again? I think you may have the dotnet8 nuget feed, and that package has some issues. If you try again you should get a new version.

@mattleibow mattleibow added the s/needs-info Issue needs more info from the author label Aug 11, 2023
@ghost
Copy link

ghost commented Aug 11, 2023

Hi @TommiGustafsson-HMP. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@TommiGustafsson-HMP
Copy link
Contributor Author

Meanwhile I have reinstalled VS 2022 Preview (17.8.0 Preview 1.0) and it works for net8.0-android project. But the stable version (17.7.0) gives the following error, when rebuilding inside Visual Studio:

Failed to restore C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj (in 40 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>C:\Program Files\dotnet\sdk\7.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: android
1>C:\Program Files\dotnet\sdk\7.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore
1>Done building project "MauiApp1b.csproj".

image

HOWEVER, if I do dotnet build in Developer PowerShell, the empty MAUI app builds.

PS C:\hmp\Test2\MauiApp1b> dotnet build
MSBuild version 17.8.0-preview-23367-03+0ff2a83e9 for .NET
  Determining projects to restore...
  Restored C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj (in 25,09 sec).
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(254,5): warning NETSDK12
01: For projects targeting .NET 8.0 and higher, specifying a RuntimeIdentifier will no longer produce a self contained app by default. To continue building se
lf-contained apps, set the SelfContained property to true or use the --self-contained argument. [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFram
ework=net7.0-ios]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK10
57: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFramework=net
7.0-ios]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(254,5): warning NETSDK12
01: For projects targeting .NET 8.0 and higher, specifying a RuntimeIdentifier will no longer produce a self contained app by default. To continue building se
lf-contained apps, set the SelfContained property to true or use the --self-contained argument. [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFram
ework=net7.0-maccatalyst]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK10
57: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFramework=net
7.0-maccatalyst]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(254,5): warning NETSDK12
01: For projects targeting .NET 8.0 and higher, specifying a RuntimeIdentifier will no longer produce a self contained app by default. To continue building se
lf-contained apps, set the SelfContained property to true or use the --self-contained argument. [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFram
ework=net7.0-windows10.0.19041.0]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK10
57: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFramework=net
7.0-windows10.0.19041.0]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK10
57: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFramework=net
7.0-android]
  MauiApp1b -> C:\hmp\Test2\MauiApp1b\MauiApp1b\bin\Debug\net7.0-ios\iossimulator-x64\MauiApp1b.dll
  MauiApp1b -> C:\hmp\Test2\MauiApp1b\MauiApp1b\bin\Debug\net7.0-maccatalyst\maccatalyst-x64\MauiApp1b.dll
  MauiApp1b -> C:\hmp\Test2\MauiApp1b\MauiApp1b\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\MauiApp1b.dll
  MauiApp1b -> C:\hmp\Test2\MauiApp1b\MauiApp1b\bin\Debug\net7.0-android\MauiApp1b.dll

Build succeeded.

C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(254,5): warning NETSDK12
01: For projects targeting .NET 8.0 and higher, specifying a RuntimeIdentifier will no longer produce a self contained app by default. To continue building se
lf-contained apps, set the SelfContained property to true or use the --self-contained argument. [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFram
ework=net7.0-ios]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(254,5): warning NETSDK12
01: For projects targeting .NET 8.0 and higher, specifying a RuntimeIdentifier will no longer produce a self contained app by default. To continue building se
lf-contained apps, set the SelfContained property to true or use the --self-contained argument. [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFram
ework=net7.0-maccatalyst]
C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(254,5): warning NETSDK12
01: For projects targeting .NET 8.0 and higher, specifying a RuntimeIdentifier will no longer produce a self contained app by default. To continue building se
lf-contained apps, set the SelfContained property to true or use the --self-contained argument. [C:\hmp\Test2\MauiApp1b\MauiApp1b\MauiApp1b.csproj::TargetFram
ework=net7.0-windows10.0.19041.0]
    3 Warning(s)
    0 Error(s)

Time Elapsed 00:03:25.94

But it still does not rebuild inside Visual Studio (stable). So, is this a tooling problem? How do I get Visual Studio to work?

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Aug 11, 2023
@mattleibow mattleibow added the s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue label Aug 16, 2023
@ghost
Copy link

ghost commented Aug 16, 2023

Thanks for the issue report @TommiGustafsson-HMP! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.

@TommiGustafsson-HMP
Copy link
Contributor Author

@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/android 🤖 s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants