Unreal Game Sync Fails to Generate Projectile Files for Workspace

Hello,
I am having an issue with a test workspace I am setting up through Perforce. Currently, I have two workspaces:

  1. The original/main workspace that has the engine and the game project.
  2. A test workspace that has the latest revision from the repository.

In UnrealGameSync, the project/engine from the original main repository is able to compile and build the editor successfully. (I have posted the logs for the successful build.)

For the test repository, after I had gotten the latest changes/revision, I attempted to run UnrealGameSync for this new repo, but it fails to generate Unreal Engine 4 projectiles with the error - ERROR: UnrealBuildTool Failed to compile, with additional info -

“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targe
ts(4206,5): error MSB3021: Unable to copy file “obj\Development\DotNETUtilities.dll” to “…......\Binaries\DotNET\Do
tNETUtilities.dll”. Access to the path ‘…......\Binaries\DotNET\DotNETUtilities.dll’ is denied. [E:\DevinRepo\Engin
e\Source\Programs\DotNETCommon\DotNETUtilities\DotNETUtilities.csproj]”

The next thing I tried was, in the test repository, to run the Setup.bat and the GenerateProjectFiles.bat. The Setup.bat does its thing and downloaded/installed the pre-requisites, but after when I run GenerateProjectileFiles.bat, I get the error described above.

I thought maybe it was a permissions issue, so I ensured that permissions were set correctly in this directory and the directory where visual studio is installed. Just in case you need the info -

“E:\DevinRepo” - test repository

“E:\MainRepo” - main repository

“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community” - Visual Studio

I have no idea as to why access to that path is denied when attempting to build and compile with one repository, but its successful with another. Can anybody shed some light on this? Thank you in advance.

Failed Compilation

Successful Compilation

Hello,

Quick caveat that I use P4V and UE4, but I am not terribly familiar with the concept of Unreal Game Sync.

Most likely the files you are trying to build and replace are not checked out by the second workstation. Files will be read-only on the second workstation until you check them out, manually make them writable, or add them to a p4ignore file. I recommend temporarily making those files writeablein the Binaries folder, and if that resolves the issue you can reconcile offline work for the Binaries folder. The same thing applies to the Intermediate folder.

You were definitely correct about making the files writable. I had originally followed this tutorial to set up the initial workspace and add the engine/project into the repo: Populating Perforce With An Unreal Engine Source Build

It seems that in the newer workspaces, I forgot this step:

I additionally checked the parameter for Allwrite; just to ensure writing was possible. Making this change with a new workspace got the originally error to go away; however I ran into a different error next. I don’t have the error anymore because I found the fix, but it was something along the lines that the directory for DerivedDataCache not existing. The reason why it doesn’t exist is because the Perforce tutorial I had followed included DerivedDataCache/ inside of the .p4ignore file.

The fix for this was to follow this UE4 documentation - Derived Data Cache | Unreal Engine Documentation. Updating DefaultEngine.ini with this new section outlined in the documentation and submitting onto my repo fixed the second error.

Now I am able to create workspaces and compile the engine like normal. Thank you for your help @IanBerget. I will make a video and upload to my YouTube channel outlining this issue and discussing the solution(s) that worked for me. I will link that video as a comment on this thread in case others run into something similar.

You’re welcome. and I appreciate your contributing the video!

Here is the video: UNREAL ENGINE 4 TUTORIAL SERIES 04: FIXING UE4 SOURCE ENGINE COMPILATION WRITE ACCESS ERROR IN UGS - YouTube