Cannot create a macOS build (macOS Sonoma Public Beta)

I tried changing the supported architectures for my project to include Intel Macs too (I use Apple Sillicon) and for some reason UnrealBuildTool now keeps complaining about the DefaultArchitecture and TargetArchitecture values being invalid and I cannot make a new build even if I try to set it back to “Host”. Happens on Xcode project generation and packaging a build.

==============================================================================
ERROR: Unknown TargetArchitecture value found ('mactargetarchitecturehost') in .ini
       (see /Users/vivi/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

BuildException: Unknown TargetArchitecture value found ('mactargetarchitecturehost') in .ini
   at UnrealBuildTool.MacArchitectureConfig.GetProjectArchitectures(FileReference ProjectFile, String TargetName, Boolean bGetAllSupported, Boolean bIsDistributionMode) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/UnrealBuildTool/Platform/Mac/UEBuildMac.cs:line 205
   at UnrealBuildTool.MacArchitectureConfig.ActiveArchitectures(FileReference ProjectFile, String TargetName) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/UnrealBuildTool/Platform/Mac/UEBuildMac.cs:line 140
   at AutomationTool.ProjectUtils.CompileAndLoadTargetsAssembly(ProjectProperties Properties, FileReference TargetsDllFilename, Boolean DoNotCompile, List`1 TargetScripts) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/ProjectUtils.cs:line 852
   at AutomationTool.ProjectUtils.DetectTargetsForProject(ProjectProperties Properties, List`1 ExtraSearchPaths) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/ProjectUtils.cs:line 828
   at AutomationTool.ProjectUtils.DetectProjectProperties(FileReference RawProjectPath, List`1 ClientTargetPlatforms, List`1 ClientTargetConfigurations, Boolean AssetNativizationRequested) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/ProjectUtils.cs:line 633
   at AutomationTool.ProjectUtils.GetProjectProperties(FileReference RawProjectPath, List`1 ClientTargetPlatforms, List`1 ClientTargetConfigurations, Boolean AssetNativizationRequested) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/ProjectUtils.cs:line 175
   at AutomationTool.ProjectParams.AutodetectSettings(Boolean bReset) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/ProjectParams.cs:line 2362
   at AutomationTool.ProjectParams..ctor(FileReference RawProjectPath, BuildCommand Command, String Device, String MapToRun, String AdditionalServerMapParams, ParamList`1 Port, String RunCommandline, String StageCommandline, String BundleName, String StageDirectoryParam, String UnrealExe, String UE4Exe, String SignPak, List`1 ClientConfigsToBuild, List`1 ServerConfigsToBuild, ParamList`1 MapsToCook, ParamList`1 MapIniSectionsToCook, ParamList`1 DirectoriesToCook, String DDCGraph, String InternationalizationPreset, ParamList`1 CulturesToCook, ParamList`1 ClientCookedTargets, ParamList`1 EditorTargets, ParamList`1 ServerCookedTargets, List`1 ClientTargetPlatforms, Dictionary`2 ClientDependentPlatformMap, List`1 ServerTargetPlatforms, Dictionary`2 ServerDependentPlatformMap, Nullable`1 Build, Nullable`1 SkipBuildClient, Nullable`1 SkipBuildEditor, Nullable`1 Cook, Nullable`1 Run, Nullable`1 SkipServer, Nullable`1 Clean, Nullable`1 Compressed, Nullable`1 ForceUncompressed, String AdditionalPakOptions, String AdditionalIoStoreOptions, Nullable`1 IterativeCooking, String IterateSharedCookedBuild, Nullable`1 IterateSharedBuildUsePrecompiledExe, Nullable`1 CookAll, Nullable`1 CookPartialGC, Nullable`1 CookInEditor, String CookOutputDir, Nullable`1 CookMapsOnly, Nullable`1 CookOnTheFly, Nullable`1 CookOnTheFlyStreaming, Nullable`1 UnversionedCookedContent, Nullable`1 OptionalContent, Nullable`1 EncryptIniFiles, Nullable`1 EncryptPakIndex, Nullable`1 EncryptEverything, Nullable`1 SkipCookingEditorContent, String AdditionalCookerOptions, String OriginalReleaseVersion, String BasedOnReleaseVersion, String CreateReleaseVersion, String CreateReleaseVersionBasePath, String BasedOnReleaseVersionBasePath, String ReferenceContainerGlobalFileName, String ReferenceContainerCryptoKeys, Nullable`1 GeneratePatch, Nullable`1 AddPatchLevel, Nullable`1 StageBaseReleasePaks, String DiscVersion, String DLCName, String DLCOverrideCookedSubDir, String DLCOverrideStagedSubDir, String DiffCookedContentPath, Nullable`1 DLCIncludeEngineContent, Nullable`1 DLCPakPluginFile, Nullable`1 DLCActLikePatch, Nullable`1 CrashReporter, Nullable`1 DedicatedServer, Nullable`1 Client, Nullable`1 Deploy, String DeployFolder, String GetFile, Nullable`1 FileServer, Nullable`1 Foreign, Nullable`1 ForeignCode, Nullable`1 LogWindow, Nullable`1 NoCleanStage, Nullable`1 NoClient, Nullable`1 NoDebugInfo, Nullable`1 SeparateDebugInfo, Nullable`1 MapFile, Nullable`1 NoXGE, Nullable`1 SkipPackage, Nullable`1 NeverPackage, Nullable`1 Package, Nullable`1 Pak, Nullable`1 IgnorePaksFromDifferentCookSource, Nullable`1 IoStore, Nullable`1 Cook4IoStore, Nullable`1 ZenStore, String NoZenAutoLaunch, Nullable`1 SkipIoStore, Nullable`1 GenerateOptimizationData, Nullable`1 Prereqs, String AppLocalDirectory, Nullable`1 NoBootstrapExe, Nullable`1 SignedPak, Nullable`1 PakAlignForMemoryMapping, Nullable`1 RehydrateAssets, Nullable`1 NullRHI, Nullable`1 FakeClient, Nullable`1 EditorTest, Nullable`1 RunAutomationTests, String RunAutomationTest, Nullable`1 CrashIndex, Nullable`1 SkipCook, Nullable`1 SkipCookOnTheFly, Nullable`1 SkipPak, Nullable`1 PrePak, Nullable`1 SkipStage, Nullable`1 Stage, Nullable`1 Manifests, Nullable`1 CreateChunkInstall, Nullable`1 SkipEncryption, Nullable`1 Unattended, Nullable`1 NumClients, Nullable`1 Archive, String ArchiveDirectoryParam, Nullable`1 ArchiveMetaData, Nullable`1 CreateAppBundle, String SpecifiedClientTarget, String SpecifiedServerTarget, ParamList`1 ProgramTargets, Nullable`1 Distribution, String PackageEncryptionKeyFile, Nullable`1 Prebuilt, Nullable`1 RunTimeoutSeconds, String SpecifiedArchitecture, String ServerArchitecture, String EditorArchitecture, String ClientArchitecture, String ProgramArchitecture, String UbtArgs, String AdditionalPackageOptions, Nullable`1 IterativeDeploy, Nullable`1 FastCook, Nullable`1 IgnoreCookErrors, Nullable`1 CodeSign, Nullable`1 TreatNonShippingBinariesAsDebugFiles, Nullable`1 UseExtraFlavor, String Provision, String Certificate, String Team, Boolean AutomaticSigning, String Trace, String TraceHost, String TraceFile, String SessionLabel, ParamList`1 InMapsToRebuildLightMaps, ParamList`1 InMapsToRebuildHLOD, ParamList`1 TitleID, Nullable`1 RetainStagedDirectory) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/ProjectParams.cs:line 1249
   at BuildCookRun.SetupParams() in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 49
   at BuildCookRun.ExecuteBuild() in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 40
   at AutomationTool.BuildCommand.Execute() in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs:line 344
   at AutomationTool.BuildCommand.ExecuteAsync() in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs:line 353
   at AutomationTool.Automation.ExecuteAsync(List`1 CommandsToExecute, Dictionary`2 Commands) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 257
   at AutomationTool.Automation.ProcessAsync(ParsedCommandLine AutomationToolCommandLine, StartupTraceListener StartupListener, HashSet`1 ScriptModuleAssemblies) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 156
==============================================================================
AutomationTool executed for 0h 0m 2s
AutomationTool exiting with ExitCode=1 (Error_Unknown)

I’ve noticed that in DefaultEngine.ini the only thing that’s different is the fact that the editor added properties for the architectures

UBT doesn’t seem to read that properly, so it seems like the only way I can make an Intel Mac build on Apple Silicon is if I remove these properties and compile a “For Distribution” build, which includes all architectures.

1 Like

Did you find another workaround for this? Or do you still have to tick the “For Distribution” flag to get a Universal build?

I get this error when I enable that option:

Merging architectures '/var/folders/y0/ts1v9rgn6xndr9yp1p2pxqlm0000gn/T/tmp.zwc3dzib/x86_64.dSYM/Contents/Resources/DWARF/x86_64 /var/folders/y0/ts1v9rgn6xndr9yp1p2pxqlm0000gn/T/tmp.zwc3dzib/arm64.dSYM/Contents/Resources/DWARF/arm64' together into /Users/karlingen/Library/Developer/Xcode/DerivedData/DemoGame_Mac_DemoGame-cfgvybpokeektihjfcoabdgqjihy/ArchiveIntermediates/DemoGame/BuildProductsPath/Mac/DemoGame-Mac-Shipping.app.dSYM
UATHelper: Packaging (Mac): /Users/karlingen/Library/Developer/Xcode/DerivedData/DemoGame_Mac_DemoGame-cfgvybpokeektihjfcoabdgqjihy/ArchiveIntermediates/DemoGame/IntermediateBuildFilesPath/DemoGame (Mac).build/Mac/DemoGame.build/Script-07D2E387F664B4E596761545.sh: line 9: /Users/Shared/Epic Games/UE_5.3/Engine/Build/BatchFiles/Mac/ThinApp.sh: No such file or directory
UATHelper: Packaging (Mac): Command PhaseScriptExecution failed with a nonzero exit code
UATHelper: Packaging (Mac): ** ARCHIVE FAILED **
UATHelper: Packaging (Mac): The following build commands failed:
UATHelper: Packaging (Mac):    PhaseScriptExecution Generate\ dsym\ for\ archive,\ and\ strip /Users/karlingen/Library/Developer/Xcode/DerivedData/DemoGame_Mac_DemoGame-cfgvybpokeektihjfcoabdgqjihy/ArchiveIntermediates/DemoGame/IntermediateBuildFilesPath/DemoGame\ (Mac).build/Mac/DemoGame.build/Script-07D2E387F664B4E596761545.sh (in target 'DemoGame' from project 'DemoGame (Mac)')
UATHelper: Packaging (Mac): (1 failure)
UATHelper: Packaging (Mac): Package command time: 24.80 s
UATHelper: Packaging (Mac): ********** PACKAGE COMMAND COMPLETED **********
UATHelper: Packaging (Mac): ********** ARCHIVE COMMAND STARTED **********
UATHelper: Packaging (Mac): Archiving to /Users/karmet/Desktop/Gamedev/Unreal/FoodBlast/Build
UATHelper: Packaging (Mac): staging targets: 'FoodBlast', 'Shipping'
UATHelper: Packaging (Mac): Unable to find a .xcarchive in Xcode's Library to archive to /Users/karmet/Desktop/Gamedev/Unreal/FoodBlast/Build/Mac
UATHelper: Packaging (Mac): Archive command time: 0.03 s
UATHelper: Packaging (Mac): ********** ARCHIVE COMMAND COMPLETED **********

I got it working by building from command line instead:

"/Users/Shared/Epic Games/UE_5.3/Engine/Build/BatchFiles/RunUAT.sh" BuildCookRun -nop4 -utf8output -nocompileeditor -skipbuildeditor -cook -project=/Users/karlingen/Desktop/Gamedev/Unreal/DemoGame/DemoGame.uproject -target=DemoGame -unrealexe="/Users/Shared/Epic Games/UE_5.3/Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor" -platform=Mac -installed -stage -archive -package -build -clean -pak -iostore -compressed -prereqs -archivedirectory=/Users/karlingen/Desktop/Gamedev/Unreal/DemoGame/Build -clientconfig=Development -nocompile -nocompileuat -specifiedarchitecture=arm64+x86_64

The key is to provide the parameter -specifiedarchitecture=arm64+x86_64 to the RunUAT.sh script, as mentioned in the docs Supporting Universal Binaries for macOS in Unreal Engine | Unreal Engine 5.3 Documentation

It’s also important to run the script with the parameters shown inside the editor, as mentioned in these docs: Build Operations: Cooking, Packaging, Deploying, and Running Projects in Unreal Engine | Unreal Engine 5.3 Documentation