Dealing with UE 4.27 build errors after upgrading to macOS Ventura 13.3.1

After upgrading to macOS Ventura 13.3.1 and being forced to install the new Xcode 14.3, all my UE projects started to produce the following error during build:

NameTypes.h:536:10: error: use of bitwise ‘&’ with boolean operands [-Werror,-Wbitwise-instead-of-logical]

The solution to this problem is two part:

  • First, downgrade Xcode 14.3 to Xcode 13.4.1;
  • Second, edit the project’s *.target.cs to disable the compiler flag -Wunused-but-set-variable;

Step 1: downgrade Xcode to 13.4.1

This version can be downloaded from: https://xcodereleases.com/

  • Once downloaded, go to your Downloads folder and double-click Xcode_13.4.1.xip to extract it to Xcode.app;
  • When the extraction process finishes, open the Terminal and cd to your Downloads folder and rename Xcode.app to Xcode13.4.1.app;
    cd ~/Downloads
    mv Xcode.app Xcode13.4.1.app
    
  • Next, move it into the Applications folder;
    mv ~/Downloads/Xcode13.4.1.app /Applications
    
  • Make sure Xcode command line tools points to this older version of Xcode:
    sudo xcode-select -s /Applications/Xcode13.4.1.app/Contents/Developer/
    
  • Finally, you can open Xcode 13.4.1 using the cmd-line by running:
    open /Applications/Xcode13.4.1.app/Contents/MacOS/Xcode
    
  • Since its annoying to have to use the previous command every time you want to open this version of Xcode, it is possible to set it as the default version using the script shared on this answer;

Step 2: edit the project’s *.target.cs files

At this point, building UE projects that have custom C++ code will generate the following error:

Material.h:1279:26: error: variable 'LayerNames' set but not used [-Werror,-Wunused-but-set-variable]

To solve this issue, simply edit both Source/*.Target.cs files and add these lines:

// fix error: "variable 'LayerNames' set but not used"
bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = "-Wno-unused-but-set-variable";
2 Likes

Hi there. Many thanks for sharing this solution, especially in such a nice understandable way. Do you know if this would still work, since we are forced to build with iOS SDK 16 or newer? I haven’t been able to use iOS SDK 16 with Xcode 13 in the past.

Edit: In the meantime I was able to fix on of the other issues:

NameTypes.h:536:10: error: use of bitwise ‘&’ with boolean operands [-Werror,-Wbitwise-instead-of-logical]

You can simply replace the single & with && and | with || in the source files that produce those errors. After that I was able to build with Xcode 14.3 in 4.27

After a long time, I needed to build a project on iOS. My project was going great on macOS BigSur and XCode 12.5 and I deployed it perfectly on iPhone 7. When trying to upload the Shipping version of the game to Transporter, he wrote:

ERROR ITMS-90725: "SDK version issue. This app was built with the iOS 14.5 SDK. All iOS and iPad OS apps submitted to the App Store must be built with the iOS 16.1 SDK or later, included in Xcode 14.1 or later.

I upgraded MacOS to the latest available version Ventura 13.4 and installed XCode 14.3.

I build my project on Windows 10 using a remote Mac build (RSync) using a ready-made build of the 4.27.2 engine from Epic Game Launcher. I was looking for workarounds so as not to use the source files of the engine.

In the *.cs project files, I added:

YourGame.Target.cs
after ExtraModuleNames.Add(“YourGame”);

// For XCode 14.3
bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = " -Wno-bitwise-instead-of-logical -Wno-unused-but-set-variable";

YourGameEditor.Target.cs
after ExtraModuleNames.Add(“YourGame”);

// For XCode 14.3
bOverrideBuildEnvironment = true;

Click Refresh Solution and Build Project

My project got together and Transporter accepted it

4 Likes

Thank you a lot man, you save my life