Maui Sample with errors NU1012 and NETSDK1139 "The target platform identifier android was not recognized"

Josh Linker 0 Reputation points
2023-08-08T17:36:32.0233333+00:00

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?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,389 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ash Singh 5 Reputation points
    2024-03-10T20:06:17.6033333+00:00

    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.

    1 person found this answer helpful.

  2. Josh Linker 0 Reputation points
    2023-08-09T18:10:15.96+00:00

    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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.