(UE5) UATHelper: Packaging (IOS): ERROR: CodeSign Failed

Developing a ios app in Unreal Engine 5. 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

Answered by DTS Engineer in 752183022

I recommend that you not trust LLMs when it comes to code siging issues. The quality of answers you get depends on the input dataset and, presuming that the input dataset comes from the wider Internet, a lot of it is simply wrong.

Specifically, in this case, the LLM advice might have set you on the right path but your solution is very concerning:

[I] applied the same command a few times just to make sure.

Rather than finding the root cause of the problem, you’ve applied I hackaround, and an non-deterministic hackaround at that.

Your error message included this text:

ERROR: CodeSign Failed UATHelper: Packaging (IOS): (see /Users/jordansktorres/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

Did you look at that Log.txt file? I’m hoping it containing the actual error message ouput by the codesign command, which should give you an insight into the actual issue.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

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.

Accepted Answer

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 😂 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: 👊

I recommend that you not trust LLMs when it comes to code siging issues. The quality of answers you get depends on the input dataset and, presuming that the input dataset comes from the wider Internet, a lot of it is simply wrong.

Specifically, in this case, the LLM advice might have set you on the right path but your solution is very concerning:

[I] applied the same command a few times just to make sure.

Rather than finding the root cause of the problem, you’ve applied I hackaround, and an non-deterministic hackaround at that.

Your error message included this text:

ERROR: CodeSign Failed UATHelper: Packaging (IOS): (see /Users/jordansktorres/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

Did you look at that Log.txt file? I’m hoping it containing the actual error message ouput by the codesign command, which should give you an insight into the actual issue.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

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>'

(UE5) UATHelper: Packaging (IOS): ERROR: CodeSign Failed
 
 
Q