Target Platform Identifier error in MAC System

Sanjay Kumar Jha 156 Reputation points
2022-09-08T09:28:25.633+00:00

Hi

I am getting following error when i build my MAUI application in MAC.

/usr/local/share/dotnet/sdk/5.0.408/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(5,5): Error NETSDK1139: The target platform identifier android was not recognized. (NETSDK1139) (LiftTrackMobileApp).

How can this error be resolved. I have also installed .Net 6.0 sdk on my MAC machine.but still i am getting this error.

Attaching screenshot for help.238993-screenshot-2022-09-08-at-23608-pm.png

Developer technologies .NET .NET MAUI
{count} vote

2 answers

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2022-09-09T06:02:35.063+00:00

    Hello @Sanjay Kumar Jha ,

    This error is related to the ** maui workload** , you could install the maui-android and maui-ios workloads manually, or modify your existing installation to make sure .NET, .NET MAUI, Android, iOS workloads are installed. For more details, you can refer to Build your first .NET MAUI app - .NET MAUI | Microsoft Learn

    In addition, please open your csproj, and check if there is the TargetFrameworks element :

    <TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>//This element is not in your screenshot  
    

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. f.hintsch 6 Reputation points
    2023-07-10T10:06:41.9033333+00:00

    % launchctl setenv MSBuildEnableWorkloadResolver true

    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.