dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.19k stars 1.75k forks source link

Could not find workload 'ios' extended by workload 'maui-ios' in manifest 'microsoft.net.sdk.maui' #20686

Closed kimbirkelund closed 8 months ago

kimbirkelund commented 8 months ago

Description

When attempting to pair-to-mac I get the following error:

Could not install workload 'ios'. Details: Unhandled exception: Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestCompositionException: Could not find workload 'ios' extended by workload 'maui-ios' in manifest 'microsoft.net.sdk.maui' [/Users/kbi/Library/Caches/Xamarin/XMA/SDKs/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.3/WorkloadManifest.json]
   at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.<>c__DisplayClass26_0.<<EnumerateWorkloadWithExtends>g__EnumerateWorkloadWithExtendsRec|0>d.MoveNext()
   at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.<>c__DisplayClass26_0.<<EnumerateWorkloadWithExtends>g__EnumerateWorkloadWithExtendsRec|0>d.MoveNext()
   at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.<>c__DisplayClass26_0.<<EnumerateWorkloadWithExtends>g__EnumerateWorkloadWithExtendsRec|0>d.MoveNext()
   at System.Linq.Enumerable.AppendPrependIterator`1.LoadFromEnumerator()
   at System.Linq.Enumerable.AppendPrepend1Iterator`1.MoveNext()
   at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.GetAvailableWorkloadDefinitions()+MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer)
   at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.ValidateWorkloadIdsInput()
   at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand..ctor(ParseResult parseResult, IReporter reporter, IWorkloadResolverFactory workloadResolverFactory, IInstaller workloadInstaller, INuGetPackageDownloader nugetPackageDownloader, IWorkloadManifestUpdater workloadManifestUpdater, String tempDirPath, IReadOnlyCollection`1 workloadIds)
   at Microsoft.DotNet.Cli.WorkloadInstallCommandParser.<>c.<ConstructCommand>b__6_0(ParseResult parseResult)
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

I have the following global.json:

{
  "sdk": {
    "version": "8.0.201"
  }
}

I've tried using 8.0.101 and 8.0.102 as well with no luck. I'm using Visual Studio 17.9.0.

I've tried deleting ~/Library/Caches/Xamarin/XMA/SDKs/ on the Mac several times with no luck.

erossini commented 7 months ago

I copied from my Windows laptop to the iMac folder but I get this issue now.

PAIR-MAC

kevinjohnobrien commented 7 months ago

@erossini Things I have tried when I get this that usually work for me, in this order:

  1. Ensure you have Xcode 15.2 installed not 15.3
  2. If not using the Preview version (which did work for me), ensure you have 17.9.2, and not the latest
  3. Ensure you have "Remote Login" set to on in Mac System Settings
  4. Right mouse click on the Mac in "Part to Mac" and select "Forget this Mac", then reenter your username and password when reconnecting
  5. Restart Visual Studio
  6. Restart Windows
  7. Enter open "$HOME/Library/Caches/Xamarin" into Mac Terminal and delete the "mtbs" and "XMA" folders
  8. Give it 10 minutes!
plppp2001 commented 7 months ago

This work around worked great for me: From this link: https://developercommunity.visualstudio.com/t/After-upgrading-to-Visual-Studio-2002-v1/10615131

image

georgeinva2004 commented 7 months ago

This problem does not appear to have been corrected in 17.9.5. Will we have to wait for 17.10 or will it be corrected in the 17.9 train?

scriptBoris commented 7 months ago

This is still a problem in 17.9.5

carmanj commented 7 months ago

We're now effectively two years after MAUI was released, and these are STILL the bugs we deal with on a daily basis to even get development up and running. Pure insanity. How any of us are so engrained in the .NET ecosystem to continue putting up with this is puzzling - Stockholm syndrome at its finest!

This is a problem for me as well in 17.9.5.

plppp2001 commented 7 months ago

We're now effectively two years after MAUI was released, and these are STILL the bugs we deal with on a daily basis to even get development up and running. Pure insanity. How any of us are so engrained in the .NET ecosystem to continue putting up with this is puzzling - Stockholm syndrome at its finest!

This is a problem for me as well in 17.9.5.

There is a FIX for this bug but it hasn't been released yet though. Use the work around.

EvgenyMuryshkin commented 7 months ago

It was fixed in 17.9.4, I made prod MAUI build. Broken again in 17.9.5?

plppp2001 commented 7 months ago

It was fixed in 17.9.4, I made prod MAUI build. Broken again in 17.9.5?

If you installed and have XCode 15.3 then that breaks it.

npostma commented 6 months ago

It was fixed in 17.9.4, I made prod MAUI build. Broken again in 17.9.5?

I think so?! I have updated to 17.9.5 and its broken ...

divil5000 commented 6 months ago

It's shameful that Microsoft considers an issue fixed if the fix is only in preview software. Most of us actually using these tools to make our living are doing so in production environments, and of course we are not using preview software in production environments.

npostma commented 6 months ago

I can confirm that the preview (17.10) does not have this issue (at least for me). But its still magic .... VS connects to the MAC and it can build my application. No issues with the AOTCompiler but when i try to build commandline on the mac that i connect to (i want to do a dotnet publish so i have an .ipa file) i get the next issue to deal with. (https://stackoverflow.com/questions/78155352/build-of-maui-project-fails-after-update-of-dotnet-workload/)

DanwithArduino commented 6 months ago

Here's the fun thing for me - I can connect and run all day from one computer, but not the other. Same VS version, same target Mac. One is over VPN - but I proxied past the web filter to ensure that wasn't the issue. However, I can confirm the @plppp2001 's workaround worked for me. Running 17.9.5

nref commented 6 months ago

Had this problem in 17.9.4 and it went away after updating to 17.9.6. The mac has XCode 15.2

gtvracer commented 6 months ago

Updated to 17.9.6 and it worked (already had XCode 15.3 previously before it stopped working).

ThePastorTech commented 5 months ago

Following setup is working fine here:

Windows11 iMacPro 2017 with Sonoma 14.3.1 Xcode 15.3 VS 17.9.6

plppp2001 commented 5 months ago

Following setup is working fine here:

Windows11 iMacPro 2017 with Sonoma 14.3.1 Xcode 15.3 VS 17.9.6

I currently have (working fine and I'm connected doing Release Builds without issue);

Version 17.9.6 Windows 11 latest updates. XCodeV15.3 (Mac Mini M2) w/ Sonoma 14.4.1

TestTEMV4 commented 5 months ago

XCode V15.3 - Sonoma 14.4.1 on MacBook Pro (total reset this morning) Windows 11 latest updates

Visual Studio 2022 Version 17.10.0 Preview 7.0 alongside Visual Studio 2022 Version 17.9.6 Visual Studio 2022 Version 17.10.0 Preview 7.0 on a brand new PC just to be sure.

Two ongoing solutions: one Xamarin (with VS 17.9.6), one Maui (with VS 17.10.0) One MAUI brand new solution (with VS 17.9.6)

Xamarin solution pairs to mac. Maui solution does not pair to mac wether it is with the brand new PC or my usual PC. Maui brand new solution does not pair to mac.

see the error: WhatsApp Image 2024-05-13 à 15 14 35_3491781a

Can somebody help me? This is driving me crazy!

plppp2001 commented 5 months ago

XCode V15.3 - Sonoma 14.4.1 on MacBook Pro (total reset this morning) Windows 11 latest updates

Visual Studio 2022 Version 17.10.0 Preview 7.0 alongside Visual Studio 2022 Version 17.9.6 Visual Studio 2022 Version 17.10.0 Preview 7.0 on a brand new PC just to be sure.

Two ongoing solutions: one Xamarin (with VS 17.9.6), one Maui (with VS 17.10.0) One MAUI brand new solution (with VS 17.9.6)

Xamarin solution pairs to mac. Maui solution does not pair to mac wether it is with the brand new PC or my usual PC. Maui brand new solution does not pair to mac.

see the error: WhatsApp Image 2024-05-13 à 15 14 35_3491781a

Can somebody help me? This is driving me crazy!

Try restarting your modem/router?

TestTEMV4 commented 5 months ago

network is totally fine. thanks for answering though

maonaoda commented 5 months ago

Now it's unavailable again。 Microsoft Visual Studio Professional 2022 - 17.9.6

plppp2001 commented 5 months ago

Now it's unavailable again。 Microsoft Visual Studio Professional 2022 - 17.9.6

You need to install the latest windows update also from 2 days ago....

maonaoda commented 5 months ago

You need to install the latest windows update also from 2 days ago....

It has nothing to do with this. The problem with this ticket has been fixed in 17.9.6.

The real problem is .NET SDK 8.0.300

The specific situation is: I changed to a new m2 mac and downloaded the latest .NET SDK 8.0.300 (macOS Arm64) At the same time, I also downloaded and installed the latest .NET SDK in windows and update the vs to 17.9.7.

When I use the pair to mac function, it keeps appearing Could not install workload 'ios'.

At first I thought this was a problem here on mac /Users/XXX/Library/Caches/Xamarin/XMA/SDKs/dotnet/sdk-manifests/8.0.100 But after comparison, I found that this is consistent with the file on my windows.


Finally, I compared the mac and windows environments and found the problem

Mac:

% which dotnet
/usr/local/share/dotnet/dotnet

% dotnet workload list
maui-windows      8.0.21/8.0.100         SDK 8.0.300
maui-ios          8.0.21/8.0.100         SDK 8.0.300
maui-android      8.0.21/8.0.100         SDK 8.0.300
ios               17.2.8053/8.0.100      SDK 8.0.300
maui              8.0.21/8.0.100         SDK 8.0.300
android           34.0.95/8.0.100        SDK 8.0.300

Windows:

> dotnet workload list

android           34.0.95/8.0.100        SDK 8.0.300, VS 17.10.34902.84, VS 17.9.34728.123
ios               17.2.8062/8.0.100      SDK 8.0.300, VS 17.10.34902.84, VS 17.9.34728.123
maccatalyst       17.2.8062/8.0.100      SDK 8.0.300, VS 17.10.34902.84, VS 17.9.34728.123
maui              8.0.21/8.0.100         SDK 8.0.300
maui-android      8.0.21/8.0.100         SDK 8.0.300
maui-ios          8.0.21/8.0.100         SDK 8.0.300
maui-windows      8.0.21/8.0.100         SDK 8.0.300, VS 17.10.34902.84, VS 17.9.34728.123
wasm-tools        8.0.5/8.0.100          SDK 8.0.300, VS 17.9.34728.123

the ios workload`s version was 17.2.8053 instead of newest 17.2.8062!


But in /Users/XXX/Library/Caches/Xamarin/XMA/SDKs/dotnet/sdk-manifests/8.0.100, the ios version is indeed 17.2.8062 !!!

Then I found the folder name below /usr/local/share/dotnet/sdk-manifests/8.0.100 is still the previous version 17.2.8053 instead of 17.2.8062.

After Copying the 17.2.8062 From C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8062 to Mac /usr/local/share/dotnet/sdk-manifests/8.0.100 I finally paired to mac successfully.


The question is why [pair to mac] used the incorrect local dotnet instead of the dotnet installed via dotnet-install.sh?