xcode 6 beta 7:A 签名资源已添加修改或删除。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25639270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
xcode 6 beta 7:A signed resource has been added modified or deleted.
提问by hsafarya
When I'm running the application on device aftercleaning, removing derived data, first time it runs without any issues. Second time when I'm trying to run, it say's "A signed resource has been added modified or deleted."
当我在清理后在设备上运行应用程序时,删除派生数据,它第一次运行时没有任何问题。第二次尝试运行时,它说“已添加已签名的资源已被修改或删除”。
On the simulator app run's without problem.
在模拟器应用程序上运行没有问题。
I think it's because of extensions, I have editing, share and today extensions, when I'm deleting this extensions, then I can run second time without this message.
我认为这是因为扩展,我有编辑、共享和今天的扩展,当我删除这些扩展时,我可以在没有这条消息的情况下运行第二次。
The problem has been since from xcode 6 beta 5.
这个问题从 xcode 6 beta 5 开始就出现了。
Maybe issue related to provisioning profiles and signing ? I has created different provisioning profiles for each extension target.
也许问题与配置文件和签名有关?我为每个扩展目标创建了不同的配置文件。
So my question is, how can I fix this ? How can I run on the device second time without cleaning project?
所以我的问题是,我该如何解决这个问题?如何在不清理项目的情况下第二次在设备上运行?
采纳答案by hsafarya
Edit:There is an another workaround: for each extension target containing .swift file, add build pre-action in project running scheme configuration:
编辑:还有另一种解决方法:对于包含 .swift 文件的每个扩展目标,在项目运行方案配置中添加构建预操作:
touch "${PROJECT_DIR}/SOME SWIFT FILE IN EXTENSION.SWIFT"
So I've found a workaround for this issue. For now we can't have swift code in extensions. As mentioned in the comment
所以我找到了解决这个问题的方法。现在我们不能在扩展中使用 swift 代码。正如评论中提到的
When removed all extension targets that contains swift code it's started working normally. I think it's a bug in xcode, for now if we have extension with swift code, don't know why, but second time run gives "A signed resource has been added modified or deleted." error.
当删除所有包含 swift 代码的扩展目标时,它开始正常工作。我认为这是 xcode 中的一个错误,现在如果我们有带有 swift 代码的扩展,不知道为什么,但是第二次运行会给出“已添加修改或删除的签名资源”。错误。
回答by Cloud Xu
It is still not fixed in XCode 6 RTM. But I found an easy walk around. Simply delete the ShareExtension.appex folder under your build. Then rebuild again. You don't need to clean project, so rebuild is quite fast.
它仍然没有在 XCode 6 RTM 中修复。但我发现四处走走很容易。只需删除构建下的 ShareExtension.appex 文件夹。然后再次重建。您不需要清理项目,因此重建非常快。
A actually alias the command to do the cleaning
一个实际上别名执行清理的命令
rm -rf ~/Library/Developer/Xcode/DerivedData/<your_app>-*/Build/Products/Debug-iphoneos/ShareExtension.appex/
回答by dmzza
I used a slight modification of Cloud Xu's script to delete both the .appex and .appex.dSYM
我稍微修改了 Cloud Xu 的脚本,删除了 .appex 和 .appex.dSYM
rm -rf ~/Library/Developer/Xcode/DerivedData/YourAppName-*/Build/Products/Debug-iphoneos/com.yourcompany.Name.extension.*
You can put this in your scheme so that it executes with every build:
你可以把它放在你的方案中,以便它在每次构建时执行:
Edit scheme... > Expand the Run mode in the sidebar > Pre-actions > Click '+' > New Run Script Action.
编辑方案... > 在侧栏中展开运行模式 > 预操作 > 单击“+” > 新建运行脚本操作。