ios - 代码签名错误每当我尝试在新的 SceneKit 应用程序中替换库存文件时

标签 ios xcode swift scenekit xcode8

所以 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.

P.S: 为了方便起见,这里有一个文件结构。 FileStruct

最佳答案

通过三个简单的步骤消除此构建错误:

1) 删除 DerivedData (~/Library/Developer/Xcode/DerivedData) 中与您的应用相关的最新文件夹

2) 在终端中,cd 到当前项目目录

3) 运行

xattr -rc .

删除所有扩展属性(通常与以前在 Photoshop 中编辑过的图像文件相关)

重建您的应用!

关于ios - 代码签名错误每当我尝试在新的 SceneKit 应用程序中替换库存文件时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37830758/

相关文章:

android - Websocket 根据操作系统给出不同的数字

ios - 为什么我可以在 iPhone 和 iPad 上构建我的应用程序,甚至可以在 Xcode 中为 "iPhone"设置设备?

ios - 从框架访问 UIApplication.sharedApplication()

ios - 如何在 Swift 4.0 中以编程方式调用 GestureRecognizer 方法?

ios - UISlider 不更新 Swift 中的当前值

ios - 创建应用程序无法下载的ios链接

ios - 我如何添加带有事件指示器的时尚白色 uialertview

ios - 有没有办法在 Storyboard中将自定义 UIView 设置为 'design',并在不添加到任何特定 Controller 的情况下在多个 ViewController 中使用?

swift - 在运行时在 Swift 中定义新类

ios - 打印机点数与 iOS 点数