Compile Fails with "Exited with code 1" (Perforce)

I’m using Unreal Engine with Perforce for version control. When I compile my project in Visual Studio and run it with Ctrl + F5, I get the error exited with 1(0x1)

However:

  • The build succeeds without errors.
  • My code changes don’t apply in the game.
  • If I try to Compile on the Fly in Unreal Engine, it also fails.

What I’ve Tried:

:white_check_mark: Checked out all necessary files in Perforce before compiling.
:white_check_mark: Used Clean Solution and then Rebuild in Visual Studio.
:white_check_mark: Right-clicked the .uproject file → Generate Visual Studio project files.
:white_check_mark: Deleted Binaries, Intermediate, and Saved folders, then recompiled.
:white_check_mark: Made sure Perforce file permissions allow modifications.
:white_check_mark: Restarted Visual Studio and Unreal Engine multiple times.

Any Ideas?

Is this a Perforce-related issue? Do I need to manually check out any specific files before compiling? Any help would be appreciated!