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