Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Signing Error Whenever I try replacing stock files in new SceneKit application

So Xcode 8 was recently released and I'm still unsure as to what exactly might be causing this problem (it might be just the fact that it's a beta version of Xcode or perhaps that I'm somehow doing something incorrectly).

The problem at hand is that I'm trying to create a new SceneKit application and I'm currently messing around with the .scn files.

I created a .scn file, "hero.scn" inside of a "hero.scnassets" and also provided a .png file inside of the hero.scnassets folder by the name of "heroTexture.png"

The code normally provided by Xcode 8.0 beta 1 for this project in the "GameViewController.swift" file was edited as follows:

Original Code:

...
let scene = SCNScene(named: "art.scnassets/ship.scn")!
...
let ship = scene.rootNode.childNode(withName: "ship", recursively: true)!
ship.run(SCNAction.repeatForever(SCNAction.rotateBy(x: 0, y: 2, z: 0, duration: 1)))

Edited Code:

...
let scene = SCNScene(named: "hero.scnassets/hero.scn")!
...
let hero = scene.rootNode.childNode(withName: "hero", recursively: true)!
hero.run(SCNAction.repeatForever(SCNAction.rotateBy(x: 0, y: 2, z: 0, duration: 1)))

Error Received:

.../Xapp.app: resource fork, finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

Conclusion of Question:

Why am I getting a signing error when all I've done is simply replaced files?

Sidenote: I know how to get the code signing issue to go away but that involves restarting the entire project (which I don't mind). The problem I face however is whenever I change the files, I get this error.

P.S: Here's a file structure just for ease.FileStruct

like image 497
Mohammad Al-Ahdal Avatar asked Jun 15 '16 09:06

Mohammad Al-Ahdal


3 Answers

Get rid of this build error in three easy steps:

1) delete the most current folder related to your app in DerivedData (~/Library/Developer/Xcode/DerivedData)

2) in the terminal, cd to the current project dir

3) run

xattr -rc .

to remove all extended attributes (usually related to image files previously edited in Photoshop)

rebuild your app!

like image 124
ecume des jours Avatar answered Feb 15 '23 01:02

ecume des jours


The error is from attributes inside your image files.

Here is a simple command to find all of your png files and remove their attributes. Run this in your projects root directory from terminal. Rebuild, clean and problem solved.

find . -type f -name '*.png' -exec xattr -c {} \;
like image 34
Mark McCorkle Avatar answered Feb 15 '23 00:02

Mark McCorkle


I got the resource fork, finder information, or similar detritus not allowed error after having installed the development version of macOS and in my case it was caused by invalid attributes on some of my files.

I fixed it by searching for com.apple.FinderInfo attributes set on my files like this

ls -alR@ . > investigate.txt

Now open investigate.txt in your favorite text editor and perform a search for com.apple.FinderInfo and clear attributes on all files having this attribute set. You can do that using

xattr -c <filename> e.g. xattr -c iTunesArtwork.png

Once I cleared all my files I was able to code sign my app again.

like image 36
Peter Theill Avatar answered Feb 15 '23 00:02

Peter Theill