Xcode "Clean Project" causes Shared UE4Editor.app binary to be deleted

Reproduce:

  1. Create a C++ project.
  2. Generate Xcode project.
  3. Close UE4 editor.
  4. Open Xcode project.
  5. Build and run for the project target, not UE4 target. Observe that UE4 editor for the current project runs.
  6. Stop.
  7. Clean the project via Xcode’s Product > Clean menu option.
  8. Try to build again. Observe build failure with a message saying:

clang: error: no such file or directory: ‘/Users/Shared/UnrealEngine/4.10/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-Core.dylib’
clang: error: no such file or directory: ‘/Users/Shared/UnrealEngine/4.10/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-CoreUObject.dylib’
clang: error: no such file or directory: ‘/Users/Shared/UnrealEngine/4.10/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-Engine.dylib’
clang: error: no such file or directory: ‘/Users/Shared/UnrealEngine/4.10/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-InputCore.dylib’
ERROR: UBT ERROR: Failed to produce item: /Users/saim/Projects/Unreal/Travelers/Binaries/Mac/UE4Editor-${PROJECT_NAME}.dylib

If you check the file system, you can find that the file is actually missing.

You can reinstall the missing UE4Editor.app via Epic Launcher > Select the engine > Verify.

After “Verify”, build works again.

I think Xcode clean is removing the shared binary mistakenly.

Hey mindblender-

This is a known issue that has been reported and is under investigation (UE-23624).

Cheers

The same problem in UE 4.11.2

any workaround?

You can make a workaround. I don’t see this as a permanent one though.

Basically, you can add script target as a dependency to your main project, which will detect “Clean” action and temporarily move the stuff you want to prevent from deletion. And, also perform the reverse operation after “Clean” build finishes.

For more info on Xcode hookup:

This definitely needs to be fixed in unreal build pipeline. But, it think the script should prevent this specific issue.

Hey -

As mindblender mentioned, if you run the Verify option from the Launcher for the engine version you’re using, it should regenerate the XCode files and allow the engine to be used again.

Verifying was enough!, Thank you guys.

Why this issue is backlogged? I’ve just faced with it in UE4.14.3 and just accidentally tried “verify” in the Epic Launcher.

At least, you should fix the Epic Launcher to show some error message and suggest to try Verify" option!

Currently our resources are dedicated elsewhere and UE-23624 is not a priority item for us to work on. We don’t have a timeframe for when this may be addressed. Please keep in mind that with source code access, a programmer on your project can implement your own solution, and you are welcome to share that result with Epic for possible integration.

This still happens in UE 4.15.1 and Xcode 8.3.

I updated to Xcode 8.3, which means my PCH files were compiled with a different branch of the clang compiler. The fix for that is to Clean the project. While this fixed the PCH compiler mismatch issue, it caused several dylib files to be deleted.

If you Verify the Engine in the Epic Game Launcher, it fixes the problem.

This really should get fixed, or at least have a warning come up after cleaning the project from Xcode.

Hey Jonathan-

I’ve added a private note to the original report to indicate that this is still occurring. As mentioned in the report (Unreal Engine Issues and Bug Tracker (UE-23624)) you can work around this by choosing the Verify option for the affected engine version in the Launcher.

Thanks for updating the original report.

As a side note, Xcode 8.3 is causing some issues; see https://answers.unrealengine.com/questions/583010/error-in-unrealmathneonh-when-packaging-for-ios.html

This still happens in the pre-release (dev-ar-kit) for 4.17 BTW. Compiling for in XCode 11 beta 3, I ran clean on a project and binaries for UE4Editor all disappeared.

which is fine for most cases, but for the arkit branch, the launcher is not capable of doing that, unless I’m missing something (certainly possible).

Currently our resources are dedicated elsewhere and UE-23624 is not a priority item for us to work on. We don’t have a timeframe for when this may be addressed. Please keep in mind that Verifying the engine version from the launcher should restore any missing files and allow the project to open.

Launcher deletes shaders on launch,
Xcode deletes binaries on clean,
In game windows are completely broken by functionality,
what else should I expect from he macOS branch ?

This is still occuring as of UE4.18.3 and Xcode 9.2. This REALLY needs to be fixed, glad at least I could find out why things were going south.

Still occuring with 4.21.1 and Xcode 10.1
Verifying doesn’t work, it says I need to check running processes and I have nothing else open. Resarting doesn’t help. The only way I fixed it was to perform a clean install of ue4.

Still occuring with 4.21.1 and Xcode 10.1

Verifying doesn’t work, it says I need to check running processes and I have nothing else open. Resarting doesn’t help. The only way I fixed it was to perform a clean install of ue4.

Unfortunately, still happening in XCode 12 / UE 4.25.3 … this seems to get broken on a regular basis.