所以 Xcode 8 最近发布了,我仍然不确定到底是什么导致了这个问题(可能只是因为它是 Xcode 的测试版,或者我做错了什么)。
手头的问题是我正在尝试创建一个新的 SceneKit 应用程序,而我目前正在处理 .scn 文件。
我在“hero.scnassets”中创建了一个 .scn 文件“hero.scn”,还在 hero.scnassets 文件夹中提供了一个名为“heroTexture.png”的 .png 文件
Xcode 8.0 beta 1 通常在“GameViewController.swift”文件中为此项目提供的代码编辑如下:
原代码:
...
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)))
编辑代码:
...
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)))
收到错误:
.../Xapp.app: resource fork, finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1
问题结论:
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.
最佳答案
通过三个简单的步骤消除此构建错误:
1) 删除 DerivedData (~/Library/Developer/Xcode/DerivedData) 中与您的应用相关的最新文件夹
2) 在终端中,cd 到当前项目目录
3) 运行
xattr -rc .
删除所有扩展属性(通常与以前在 Photoshop 中编辑过的图像文件相关)
重建您的应用!
关于ios - 代码签名错误每当我尝试在新的 SceneKit 应用程序中替换库存文件时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37830758/