On mac book open the terminal.
Then run the command: sudo dotnet workload install maui
sudo means super user do followed by the command.
It worked.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am attempting to upgrade a Xamarin Project to .Net Maui. I received the dreaded "The target platform identifier android was not recognized" and "Platform version is not present for one or more of the target frameworks, even though they have specified a platform net7.0-android".
I proceeded to google the messages and tried every fix on the planet that one of them suggests. And yes, I very early on created a new empty project for .net maui and verified it also gives the error. Eventually I was led to posts where the only fix was to uninstall all the things, clean the registry, etc. I uninstalled ALL version of Visual Studio that were installed, went through add/remove programs and uninstalled ALL .net sdk's. Used the script that looks for msi references in the registry and uses powershell to uninstall those.
Then I reinstalled Visual Studio 2022, selecting the .Net Maui work load. I still get the error. If I run the following commands, here is their output...
dotnet --version
7.0.306
dotnet --list-sdks
7.0.306 [c:\Program Files\dotnet\sdk]
dotnet workload list
Installed Workload Id Manifest Version Installation Source
maui-windows 7.0.86/7.0.100 vs 17.6.33829.357
maui-maccatalyst 7.0.86/7.0.100 vs 17.6.33829.357
maccatalyst 16.4.7067/7.0.100 vs 17.6.33829.357
maui-ios 7.0.86/7.0.100 vs 17.6.33829.357
ios 16.4.7067/7.0.100 vs 17.6.33829.357
maui-android 7.0.86/7.0.100 vs 17.6.33829.357
android 33.0.46/7.0.100 vs 17.6.33829.357
I also checked the system path variable on my machine to make sure there wasn't a path variable pointing to an x86 version of the SDK's...
What else is there to check? Why is it so difficult to get a Maui project working?
On mac book open the terminal.
Then run the command: sudo dotnet workload install maui
sudo means super user do followed by the command.
It worked.
I finally figured it out!!! At some point in time the .Net Runtime for x86 had gotten installed, even though my path variables were fine it was some how confusing Visual Studio. I uninstalled that and it started working!
When I uninstalled everything I didn't uninstall the runtimes because I thought they were being used by programs, I only uninstalled the SDK's. Apparently the runtimes can interfere with the SDK's