Packaging (IOS): ERROR: CodeSign Failed ________ "HELP!" ________

Everything was alright. Until it wasn’t.
Build to iOS device. Click. Cooking. Building… “ERROR: CodeSign Failed”
D4mn it! hahaha

Here’s the log:

UATHelper: Packaging (IOS): Command CodeSign failed with a nonzero exit code
UATHelper: Packaging (IOS): ** BUILD FAILED **
UATHelper: Packaging (IOS): The following build commands failed:
UATHelper: Packaging (IOS): CodeSign /Users/jordansktorres/My\ Drive/PROJECTS/CRUZEIRO-DO-SUL/ValenteGO/ValenteGO_V1/Binaries/IOS/Payload/ValenteGO_V1.app (in target ‘ValenteGO_V1’ from project ‘ValenteGO_V1’)
UATHelper: Packaging (IOS): (1 failure)
UATHelper: Packaging (IOS): Took 12,659139s to run env, ExitCode=65
UATHelper: Packaging (IOS): ERROR: CodeSign Failed
UATHelper: Packaging (IOS): (see /Users/jordansktorres/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
UATHelper: Packaging (IOS): AutomationTool executed for 0h 1m 51s
UATHelper: Packaging (IOS): AutomationTool exiting with ExitCode=32 (Error_FailedToCodeSign)
UATHelper: Packaging (IOS): RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 32
PackagingResults: Error: Failed to Code Sign

I have deleted the binaries, build, intermediate, and saved folders. I have generated and created new certificates. I have deleted UE5 and re-install it again. I have thrown the project into the garbage can and created a whole new project file with the same content folder. It all led to the same result. “ERROR: CodeSign Failed”

Please, someone, anyone, give me a light here. hahaha :crazy_face: :sob: :ghost:

@SupportiveEntity , I summon thee! :raised_hands:

If the build is Shipping, then you may have forgotten to check the “For Distribution” checkbox in ProjectSettings and also make sure that you use a certificate and provision for Distribution


I have done that already. Many times. The problem persists. :confused:

I think I might be onto something. hehe
I believe that the prompt that appears at the end of the build process is not showing to me and resulting in the “ERROR: CodeSign Failed” because of these settings in the “MyGame”.xcodeproj file.

Does anyone know how to change this file and lock it in a way that UE5 is unable to change it or rewrite it? Because every single time that I change it, the build process changes it back.

Forget this last post. It has nothing to do with it. hahaha

So, here’s the solution to my problem.

Since the error happens at the end of my build process. I got help from GPT and it gave me a light.

GPT

I’m sorry, but I cannot provide you with a code to fix this error as the issue seems to be related to the resource fork, Finder information, or similar detritus not allowed in the file system. This is not a code issue, but rather a file system issue.

However, one possible solution to fix this issue is to remove any unnecessary files and metadata from the file system that may be causing this issue. You can use a tool like CleanMyMac or OnyX to remove any unwanted files and metadata from your Mac. Additionally, you can try copying the project to a different location or an external hard drive, and then try building the project again.

Awesome!

So now I just needed to write something in the terminal to remove all extended attributes in the .app file. Since I’m a junior dev :joy: GPT helped me again and gave this.

xattr -rc /path/to/your/file.app

Of course, change the “/path/to/your/file.app” to your own path to your .app file.

Then I needed to apply this command right when the build process was almost finished. I checked that by using the .app file size. I knew what it was usually like, so I kept watching and waiting for it to reach the right number and then applied the same command a few times just to make sure. Like shooting a zombie twice in the head. hahaha

And done. 2 days suffering with this issue. hehe :brazil: :facepunch:

4 Likes

Cool, will definitely try this out!

Thx

This unfortunately didn’t work for me, maybe I did it wrong though. Has this method been consistent for you?

Does xattr -rc update the file in anyway? I’m not getting a success/fail when I run it, and the file doesn’t update based on the timestamp

~t

Yes this is the culprit I believe we have to figure out. I managed to build properly in 5.2 preview consistently but can’t use it as I need certain plugins to work :frowning:

Hi, I’m facing the same problem here with CodeSign Failed. I built the project yesterday was succeeded. Without modified it, trying rebuild it again today, it failed. This is weird. The error as below:

Blockquote
UATHelper: Packaging (IOS): /bin/sh -c /Users/Shared/Epic\\ Games/UE_5.2/Engine/Intermediate/ProjectFilesIOS/build/UE5.build/Shipping-iphoneos/UE5.build/Script-7C566CB72ACEECA235635734.sh
UATHelper: Packaging (IOS): CodeSign /Users/Shared/Epic\ Games/UE_5.2/Engine/Binaries/IOS/Payload/UnrealGame.app (in target ‘UE5’ from project ‘UE5’)
UATHelper: Packaging (IOS): cd /Users/Shared/Epic\ Games/UE_5.2/Engine/Intermediate/ProjectFilesIOS
UATHelper: Packaging (IOS): Signing Identity: “Apple Development: Erik (AK9BP52C1K)”
UATHelper: Packaging (IOS): Provisioning Profile: “ue5demo”
UATHelper: Packaging (IOS): (e66c5b01-120c-486c-8898-64ef6c9add01)
UATHelper: Packaging (IOS): /usr/bin/codesign --force --sign AF8EE999F7B5063E5344C20003CF472808D2DD01 --generate-entitlement-der --deep --entitlements /Users/Shared/Epic\ Games/UE_5.2/Engine/Intermediate/ProjectFilesIOS/build/UE5.build/Shipping-iphoneos/UE5.build/UnrealGame.app.xcent --timestamp=none --generate-entitlement-der /Users/Shared/Epic\ Games/UE_5.2/Engine/Binaries/IOS/Payload/UnrealGame.app
UATHelper: Packaging (IOS): /Users/Shared/Epic Games/UE_5.2/Engine/Binaries/IOS/Payload/UnrealGame.app: resource fork, Finder information, or similar detritus not allowed
UATHelper: Packaging (IOS): Command CodeSign failed with a nonzero exit code
UATHelper: Packaging (IOS): ** BUILD FAILED **
UATHelper: Packaging (IOS): The following build commands failed:
UATHelper: Packaging (IOS): CodeSign /Users/Shared/Epic\ Games/UE_5.2/Engine/Binaries/IOS/Payload/UnrealGame.app (in target ‘UE5’ from project ‘UE5’)
UATHelper: Packaging (IOS): (1 failure)
UATHelper: Packaging (IOS): Took 10.525248s to run env, ExitCode=65
UATHelper: Packaging (IOS): ERROR: CodeSign Failed
UATHelper: Packaging (IOS): (see /Users/erik/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
UATHelper: Packaging (IOS): AutomationTool executed for 0h 2m 40s
UATHelper: Packaging (IOS): AutomationTool exiting with ExitCode=32 (Error_FailedToCodeSign)
UATHelper: Packaging (IOS): RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 32
PackagingResults: Error: Failed to Code Sign
Blockquote

Since all my certs and provision files are valid, and I’ve tried all the methods mentioned, deleting the Intermediate, saved, build, derivedatacache folders, installed CleanMyMac X to clean up all the metadata files, asked ChatGPT to get the terminal code for “xattr -rc /Users/…” non-stop applying it until it fully built.

Applied all the methods above still ended up the same problem with CodeSign Failed. The only thing I’ve yet to try is to recreate a new provision and certificate.

Anyone can help?

After I revoked all the provision and certs, I recreate a new one. Retry building it and get only this issue:

LogAutomationTest: Error: VectorRound32-FloatMax: The two values are not equal.

Anyone can help?

Hey @BrCruzeiroDoSul and @tbelgrave wanted to mention that I have (perhaps had) a similar issue for days now. The xattr command didn’t work for me.

However what worked consistently (until now) is to move it out of my iCloud Drive folder. If you do have it in there, try moving it to a local folder

1 Like

You probably have .DS_Store files written somewhere in the UE project.

  1. make sure that you have checked “Use PAK files” in Packaging section.
  2. go into your project folder and run: find . -name '.DS_Store' -type f -delete to delete all .DS_Store files

That should be enough to remove all finder information from the APP file before signing.

if you still get that error check APP file with xattr -lc <path to your APP file>

1 Like

Hi ! I got the same issure, did you figured it out ? :slight_smile:

(FOR MAC)
In case this helps anyone in the future with a similar problem…on UE5.3 I am working on a Silicon Mac and trying to also do an Intel compatible package…once you load up the UE app using Rosetta, when you go to cook content you get the same message. It turns out selecting “universal” packaging settings under mac won’t function correctly. You need to actively switch the architecture for all four drop down menus from “universal” to “Intel” within project settings. Once I did this, the cooking happened as intended.