Redth / dotnet-maui-check

.NET MAUI Check tool
MIT License
479 stars 79 forks source link

error when installing ".NET SDK - Workloads" using maui-check #157

Open shingming opened 2 years ago

shingming commented 2 years ago

The environment information:

Screenshot 2022-08-18 at 12 13 42 PM

SDK and MONO are up to date:

Screenshot 2022-08-18 at 12 19 55 PM

The error output:

Thanks for choosing .NET MAUI!

⏳ Synchronizing configuration... ok
⏳ Scheduling appointments... ok

πŸ”Ž OpenJDK 11.0 Checkup...
  βœ” 11.0.12 (/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/..)

πŸ”Ž Visual Studio 17.3.0.1028 Checkup...
  βœ” Visual Studio for Mac (17.3.1.411)

πŸ”Ž Android SDK Checkup...
  βœ” emulator (31.2.10)
  βœ” build-tools;31.0.0 (31.0.0)
  βœ” platforms;android-31 (1)
  βœ” system-images;android-31;google_apis;arm64-v8a (10)
  βœ” platform-tools (33.0.2)
  βœ” cmdline-tools;5.0 (5.0)

πŸ”Ž Android Emulator Checkup...
  βœ” Emulator: Pixel_5_API_29 found.

πŸ”Ž XCode 13.3 Checkup...
  βœ” Xcode.app (13.3)

πŸ”Ž .NET SDK Checkup...
  – 6.0.300 - /usr/local/share/dotnet/sdk/6.0.300
  – 6.0.400 - /usr/local/share/dotnet/sdk/6.0.400

πŸ”Ž .NET SDK - Workload Deduplication Checkup...

πŸ”Ž .NET SDK - Workloads (6.0.301) Checkup...
  ❌ android (Microsoft.NET.Sdk.Android.Manifest-6.0.300 : 32.0.440) not installed.
  ❌ ios (Microsoft.NET.Sdk.iOS.Manifest-6.0.300 : 15.4.447) not installed.
  ❌ maccatalyst (Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.400 : 15.4.447) not installed.
  ❌ tvos (Microsoft.NET.Sdk.tvOS.Manifest-6.0.400 : 15.4.447) not installed.
  ❌ macos (Microsoft.NET.Sdk.macOS.Manifest-6.0.400 : 12.3.447) not installed.
  ❌ maui (Microsoft.NET.Sdk.Maui.Manifest-6.0.300 : 6.0.419) not installed.

πŸ’‰ Recommendation: Install or Update SDK Workloads

πŸ”” Attempt to fix? [y/n] (y): y
⏳ Attempting to fix: .NET SDK - Workloads (6.0.301)
SHELL: /bin/zsh /var/folders/xc/4gl080rx7n364ctyt0cqjm3h0000gn/T/tmpyKF4ei.tmp
zsh:1: command not found: PACKAGE_SOURCE_NUGET_ORG
Password:
Unhandled exception: System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at Microsoft.DotNet.Cli.NuGetPackageDownloader.PackageSourceLocation.ExpandLocalFeed(String[] sourceFeedOverrides)
   at Microsoft.DotNet.Workloads.Workload.InstallingWorkloadCommand..ctor(ParseResult parseResult, IReporter reporter, IWorkloadResolver workloadResolver, IInstaller workloadInstaller, INuGetPackageDownloader nugetPackageDownloader, IWorkloadManifestUpdater workloadManifestUpdater, String dotnetDir, String userProfileDir, String tempDirPath, String version, String installedFeatureBand)
   at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand..ctor(ParseResult parseResult, IReporter reporter, IWorkloadResolver workloadResolver, IInstaller workloadInstaller, INuGetPackageDownloader nugetPackageDownloader, IWorkloadManifestUpdater workloadManifestUpdater, String dotnetDir, String userProfileDir, String tempDirPath, String version, IReadOnlyCollection`1 workloadIds, String installedFeatureBand)
   at Microsoft.DotNet.Cli.WorkloadInstallCommandParser.<>c.<ConstructCommand>b__6_0(ParseResult parseResult)
   at Microsoft.DotNet.Cli.ParseResultCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
Fix failed - Workload Install failed: `dotnet workload install --from-rollback-file "/var/folders/xc/4gl080rx7n364ctyt0cqjm3h0000gn/T/maui-check-dd6ad34d/workload.json" android ios maccatalyst tvos macos maui --source "$(PACKAGE_SOURCE_NUGET_ORG)"`

πŸ”” There were one or more problems detected.
Please review the errors and correct them and run maui-check again.

Press enter to exit...
shingming commented 2 years ago

I successfully install the MAUI workload by the following command: dotnet workload install maui and then type maui-check command and will get an "all ok" message

But this is just another way to avoid the error and install MAUI wordload successfully, the problem itself is not solved

reference: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-install

dodikk commented 1 year ago

For me maui-check still fails and wants Xcode 13.3 while I have the latest one Xcode 14.2. Is that ok?

So the hello world template project does not run due to (even after the successful dotnet workload install maui)

Getting restore information for project .../HelloWorld/HelloWorld.csproj
/usr/local/share/dotnet/sdk/7.0.200/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(112,5) : error NETSDK1139: The target platform identifier android was not recognized.
Unable to create package spec for project. '.../HelloWorld.csproj'

The maui-check --fix fails with the error below:

Unhandled exception: System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at Microsoft.DotNet.Cli.NuGetPackageDownloader.PackageSourceLocation.ExpandLocalFeed(String[] sourceFeedOverrides)
   at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand..ctor(ParseResult parseResult, IReporter reporter, IWorkloadResolver workloadResolver, IInstaller workloadInstaller, INuGetPackageDownloader nugetPackageDownloader, IWorkloadManifestUpdater workloadManifestUpdater, String dotnetDir, String userProfileDir, String tempDirPath, String version, IReadOnlyCollection`1 workloadIds)
   at Microsoft.DotNet.Cli.WorkloadInstallCommandParser.<>c.<ConstructCommand>b__14_0(ParseResult parseResult)
   at Microsoft.DotNet.Cli.ParseResultCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
Fix failed - Workload Install failed: `dotnet workload install --from-rollback-file 
"/var/folders/vz/td1yqc9d6zq0n8y_n02qvx3r0000gn/T/maui-check-96eaa125/workload.json" android ios 
maccatalyst tvos macos maui --source "$(PACKAGE_SOURCE_NUGET_ORG)"`
Falco20019 commented 1 year ago

The issue is, that check.dotnet.sdks.packageSources is not resolving check.variables. When adding https://api.nuget.org/v3/index.json directly, it works fine. You can download the manifest from the URL and use -m maui.manifest.json with the corrected file until fixed.