Modules missing every time a header changes

Environment is Mac Sequioa with Unreal Engine 5.5.1.

I have been working through a few courses on C++ game dev.

This issue is really driving me crazy with my workflow.

Every time I change a header file, I can compile the code fine. But when I try to start Unreal, by double-clicking the CrustyPirate.uproject file I get this error:

If I click “Yes” this happens:

The only way to get around it is to delete all these folders:

  • Intermediate
  • Build
  • Saved
  • DerivedDataCache
  • Binaries

And delete the XCode workspace: CrustyPirate (Mac).xcworkspace.

I’m using source control, but it stresses me out because I have to do this so often one day I’m going to delete the wrong thing and lose work. Its so painful.

Then finally it will build.

Using the Mac’s Console app I can see a log file called CrustyPirate-backup-date-time.log which includes these lines:

LogPluginManager: Mounting Engine plugin ConcertSyncClient
SourceControl: Revision control is disabled
SourceControl: Revision control is disabled
LogInit: Warning: Incompatible or missing module: CrustyPirate
Setting up bundled DotNet SDK
/Users/Shared/Epic Games/UE_5.5/Engine/Build/BatchFiles/Mac/../../../Binaries/ThirdParty/DotNet/8.0.300/mac-arm64
Running dotnet Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll Development Mac -Project=/Users/sez/depot/UnrealEngine2D/CrustyPirateGame/CrustyPirate.uproject -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Log file: /Users/sez/Documents/Library/Application Support/Epic/UnrealBuildTool/Log.txt
Using 'git status' to determine working set for adaptive non-unity build (/Users/sez/depot/UnrealEngine2D).
@progress push 5%
@progress pop
Target is up to date
Deploying CrustyPirateEditor Mac Development...
Deploying now!
Total execution time: 1.49 seconds
LogInit: Warning: Still incompatible or missing module: CrustyPirate

FYI - the code is here, but I don’t think its the code that is at fault.

Note that the code comes from a tutorial I’m working through - its credited fully in the repo.

Also the issue happens even if I quit Unreal and then build. As soon as I restart Unreal I get the messages.

OK - I think I have a fix for this.

I still get the error every time, but now I can fix it by manually building the editor. Now I don’t have to delete all the intermediate files.

Note that none of the targets inside XCode seem to do this for me. I’ve tried all of them and none of them work. This one should, and it completes successfully but does not satisy Unreal.

I created a script to do this.

PROJ=$(find . -name "*.uproject") 
if [ -z "$PROJ" ]; then
    echo "Run this from inside the folder containing your Unreal project - eg \"MyGame.uproject\"."
    exit 1;
fi

# Only major version as per pathname
UNREAL_VERSION=5.5
PROJ_NAME=$(basename $PROJ .uproject)
CUR_DIR=$(pwd)

sh /Users/Shared/Epic\ Games/UE_5.5/Engine/Build/BatchFiles/Mac/Build.sh \
    -ModuleWithSuffix=CrustyPirate,1877 CrustyPirateEditor Mac Development \
    -Project="${CUR_DIR}/CrustyPirate.uproject" \
    "${CUR_DIR}/CrustyPirate.uproject" \
    -architecture=arm64 -IgnoreJunk

It sounds like you’re not building in the Development configuration when you build from Xcode.

When you double click a .uproject file, Unreal Editor starts in Development mode.

As you’ve found, when you explicitly build in Development then it works fine.

In general, if you’re building c++ code in Xcode, then you also want to start the editor from Xcode – NOT by double clicking the .uproject. This is especially true if/when you build in the DebugGame configuration and you want to debug your c++.