I was able to get the UE4.25 editor running on Sonoma using Xcode 15!
Resolving -Werror and -Wdeprecated-builtins Errors
Xcode’s suppressions and compiler flags won’t work here; it turns out they need to be added in your project’s target.cs files.
I added this to both my [projectname]Editor.Target.cs
and [projectname].Target.cs
(Not sure if the latter is needed, but I did it just to be safe.)
if (Target.Platform == UnrealTargetPlatform.Mac)
{
bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = "-Wno-error -Wno-deprecated-builtins";
}
So, for instance, my [projectname]Editor.Target.cs
looks like this:
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class ProjectNameEditorTarget : TargetRules
{
public ProjectNameEditorTarget(TargetInfo Target) : base(Target)
{
if (Target.Platform == UnrealTargetPlatform.Mac)
{
bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = "-Wno-error -Wno-deprecated-builtins";
}
Type = TargetType.Editor;
ExtraModuleNames.Add("ProjectName");
}
}
You can get away with only adding the “-Wno-error” flag (which prevents warnings from generating errors) but your console will be flooded with “deprecated builtin” warnings, so I added both to make my console cleaner.
Missing MultitouchSupport Framework Error
If you get an error along the lines of clang: error: no such file or directory: '/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport'
, you can resolve it by doing a little tweak to the engine’s .cs files.
This was fixed in UE4.26(?). If you’re not experiencing this error then ignore this section.
First, go to your engine’s install (e.g. /Users/Shared/Epic Games/UE_4.25/
), and then open Engine/Source/Runtime/ApplicationCore/ApplicationCore.Build.cs
. Look for the line:
PublicAdditionalLibraries.Add("/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport");
and replace it with:
string SDKROOT = Utils.RunLocalProcessAndReturnStdOut("/usr/bin/xcrun", "--sdk macosx --show-sdk-path");
PublicAdditionalLibraries.Add(SDKROOT + "/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport.tbd");
And then save. You may get prompted that these files are locked or something. Go ahead and overwrite it/unlock it.
Next, open Engine/Source/Runtime/Core/Core.Build.cs
, find the line:
PublicAdditionalLibraries.Add("/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport");
and replace it with:
string SDKROOT = Utils.RunLocalProcessAndReturnStdOut("/usr/bin/xcrun", "--sdk macosx --show-sdk-path");
PublicAdditionalLibraries.Add(SDKROOT + "/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport.tbd");
And save. Once again, overwrite/unlock it.
“Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES”
You may get this error when trying to launch the editor through Xcode.
To resolve this,
- Go to the top of Xcode
- Click Product>Scheme>Edit Scheme
- Under the “Run” scheme, click “Arguments”
- Go to “Environment Variables”
- Click the “+” button and add
IDEPreferLogStreaming
and set the value to YES
.
This will allow UE4 to print to the console while it’s launching, and can help you see what’s going on during the eternal “Initializing” screen where it’s building shaders.
“PCH was compiled with module cache path” Error
After all this, my editor was crashing during the Initializing screen. It would happen after it finished compiling shaders at 18%.
I’m not entirely sure what steps I did to resolve this, but I’d recommend trying the following:
- Delete the ModuleCache folder listed in the error (Located somewhere in /var/folders)
- Delete your DerivedData folder (If you’re unsure where this is, go to Xcode>Settings>Locations and it should be listed there)
- Go to your engine config folder (e.g.
/Users/Shared/Epic Games/UE_4.25/Engine/Config
), open up ConsoleVariables.ini
and uncomment r.ShaderDevelopmentMode=1
, r.Shaders.Optimize=0
, and r.Shaders.KeepDebugInfo=1
(this may or may not have done anything)
You can also try deleting your project’s Build and Intermediate folders along with re-generating your project’s xcode workspace file. I had also tried reinstalled xcode, but that didn’t seem to do anything.
Only deleting the ModuleCache folder resulted in an error about missing a metal_types pcm file. I was able to fix this by deleting the DerivedData folder and relaunching Xcode.
Hope this helps!