Urgent: Windows Principal functionality is not supported on this platform

Hey Folks,
I am fighting here with a problem. I developed a game on my windows pc. Build it for android and windows (no prob so far).
Now I have to do the same for IOS, but I am a total beginner to use Apple.
I have this issue as described below: I really don’t know what the problem is. Also I can’t have a look into the log file because I really don’t know where the file is. (Apple newb)
So I think there is some data left from windows maybe?
I tried to erase windows as targeted platforms/ deleted the intermediate and save dir/ build everything again/
Anybody an Idea? It is super urgent, because of a close ddl.

ATHelper: Packaging (IOS): ERROR: System.PlatformNotSupportedException: Windows Principal functionality is not supported on this platform.
UATHelper: Packaging (IOS): at System.Security.Principal.WindowsIdentity.GetCurrent()
UATHelper: Packaging (IOS): at IOSPlatform.GetFilesToArchive(ProjectParams Params, DeploymentContext SC) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/IOS/IOSPlatform.Automation.cs:line 1495
UATHelper: Packaging (IOS): at Project.CreateArchiveManifest(ProjectParams Params, DeploymentContext SC) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/ArchiveCommand.Automation.cs:line 25
UATHelper: Packaging (IOS): at Project.Archive(ProjectParams Params) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/ArchiveCommand.Automation.cs:line 64
UATHelper: Packaging (IOS): at BuildCookRun.DoBuildCookRun(ProjectParams Params) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 208
UATHelper: Packaging (IOS): at BuildCookRun.ExecuteBuild() in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 40
UATHelper: Packaging (IOS): at AutomationTool.BuildCommand.Execute() in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs:line 323
UATHelper: Packaging (IOS): at AutomationTool.Automation.Execute(List1 CommandsToExecute, Dictionary2 Commands) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 541
UATHelper: Packaging (IOS): at AutomationTool.Automation.Process(String[] Arguments, StartupTraceListener StartupListener) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 498
UATHelper: Packaging (IOS): at AutomationTool.Program.MainProc(String[] Arguments, StartupTraceListener StartupListener) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Program.cs:line 176
UATHelper: Packaging (IOS): at AutomationTool.Program.<>c__DisplayClass1_0.b__2() in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Program.cs:line 88
UATHelper: Packaging (IOS): at AutomationTool.InternalUtils.RunSingleInstance(String[] Arguments, Func`1 Main) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/AutomationUtils/Utils.cs:line 752
UATHelper: Packaging (IOS): at AutomationTool.Program.Main(String[] Arguments) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Program.cs:line 88
UATHelper: Packaging (IOS): (see /Users/__________/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
UATHelper: Packaging (IOS): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (IOS): RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 1
PackagingResults: Error: System.PlatformNotSupportedException: Windows Principal functionality is not supported on this platform.
PackagingResults: Error: AutomationTool was unable to run successfully. Exited with code: 1
PackagingResults: Error: Unknown Error

Hello, I get the same error when I try to build iOS on MacOS.

My build environment like this:
MacOS 11.6.6
Xcode12.4
UE5.0.1

I try to build iOS IPA in this environment but get the same problems.

ERROR: System.PlatformNotSupportedException: Windows Principal functionality is not supported on this platform.
          at System.Security.Principal.WindowsIdentity.GetCurrent()
          at IOSPlatform.GetFilesToArchive(ProjectParams Params, DeploymentContext SC) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/IOS/IOSPlatform.Automation.cs:line 1471
          at AutomationScripts.Project.CreateArchiveManifest(ProjectParams Params, DeploymentContext SC) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/ArchiveCommand.Automation.cs:line 27
          at AutomationScripts.Project.Archive(ProjectParams Params) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/ArchiveCommand.Automation.cs:line 66
          at BuildCookRun.DoBuildCookRun(ProjectParams Params) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 209
          at BuildCookRun.ExecuteBuild() in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 41
          at AutomationTool.BuildCommand.Execute() in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs:line 344
          at AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 254
          at AutomationTool.Automation.Process(ParsedCommandLine AutomationToolCommandLine, StartupTraceListener StartupListener, HashSet`1 ScriptModuleAssemblies) in /Users/build/Build/++UE5/Sync/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 153
       (see /Users/zhangguosong/Library/Logs/Unreal Engine/LocalBuildLogs/+Users+Shared+Epic+Games+UE_5.0/Log.txt for full exception trace)

And I try to search the source code of AutomationTool in Engine/Sources/Programs/AutomationTool/IOS/IOSPlatform.Automation.cs, it seems that the follow code in GetFilesToArchive function cause this problem

if (bXCArchive && !RuntimePlatform.IsWindows)
		{
			// Always put the archive in the current user's Library/Developer/Xcode/Archives path if not on the build machine
			WindowsIdentity id = WindowsIdentity.GetCurrent();
			string ArchivePath = "/Users/" + id.Name + "/Library/Developer/Xcode/Archives";
			if (IsBuildMachine)
			{
				ArchivePath = Params.ArchiveDirectoryParam;
			}
			if (!DirectoryExists(ArchivePath))
			{
				CreateDirectory(ArchivePath);
			}

the WindowsIdentity.GetCurrent() function seems not support on MacOS, but I’am not sure.

Setting “Generate XCode Archive” to false in iOS settings solved the issue for me.

A fix for this issue has been committed and should make it into a future HotFix release. Thanks,

Adam