xcode 捆绑格式无法识别、无效或不合适
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40318003/
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
bundle format unrecognized, invalid, or unsuitable
提问by fzh
Xcode:8.1
代码:8.1
language:Objective-C
语言:Objective-C
I can run the project on my iPhone, but can't run on the simulator.
我可以在我的 iPhone 上运行该项目,但不能在模拟器上运行。
I tried:
我试过:
1)deleting all data of the DerivedData folder
1)删除DerivedData文件夹的所有数据
2)cleaning the project and restart the project.
2)清理项目并重新启动项目。
3)deleting the resources folder.
3)删除资源文件夹。
but that didn't work!
但这没有用!
采纳答案by Airman00
Are you using CocoaPods? Updating CocoaPods itself + then all the pods worked from me.
你在使用 CocoaPods 吗?更新 CocoaPods 本身 + 然后所有的豆荚都在我这里工作。
Note: this is right after the Xcode autoupdate today.
注意:这是在今天 Xcode 自动更新之后。
回答by Lo?c Gardiol
For those for whom updating Cocoapods or reverting Xcode to 8.0 is not an option, here is a solution that worked for me:
对于那些无法更新 Cocoapods 或将 Xcode 恢复到 8.0 的人来说,这里有一个对我有用的解决方案:
- Right click on
Pods
in the Project Navigator - Click
New File...
- Select
Property List
- Save the file under the name
Pods-Info.plist
(for example) and leave it empty - Select
Pods
in the Project Navigator - Select the
Pods
project, thenBuild Settings
- Search for
Info.plist
- Set the value of
Info.plist File
toPods-Info.plist
Pods
在项目导航器中右键单击- 点击
New File...
- 选择
Property List
- 以名称
Pods-Info.plist
(例如)保存文件并将其留空 Pods
在项目导航器中选择- 选择
Pods
项目,然后Build Settings
- 搜索
Info.plist
- 将值设置
Info.plist File
为Pods-Info.plist
回答by Zhen Zhang
I had the same problem. I did the following steps, and it sovled. Select Pods in the navigation --> TARGETS --> your FDTakeResources --> Signing(Enable Development Signing) --> Identity(Choose Info.plist File). Then I can run it on my simulator.
我有同样的问题。我做了以下步骤,它解决了。在导航中选择Pods --> TARGETS --> your FDTakeResources --> Signing(Enable Development Signing) --> Identity(Choose Info.plist File)。然后我可以在我的模拟器上运行它。
回答by Denis
This is not the solution for topic-starter, however in my case I've recieved this error about 'bundle format unrecognized, invalid, or unsuitable' during CocoaPods post-build embed frameworks action on attempt to sign any framework. More of that, the issue was reproduced only when running build on Jenkins.
这不是 topic-starter 的解决方案,但是在我的情况下,我在 CocoaPods 构建后嵌入框架尝试签署任何框架的操作期间收到了有关“无法识别的捆绑格式、无效或不合适”的错误。更重要的是,只有在 Jenkins 上运行构建时才会重现该问题。
The reason was really stupid. Jenkins was using the custom output directory, which did include space char in the middle. The CP post-build generated script doesn't handle paths with spaces properly, so the codesign tool actually was not fed with the correct path to framework.
理由真的很蠢。Jenkins 正在使用自定义输出目录,其中确实包含中间的空格字符。CP 构建后生成的脚本没有正确处理带有空格的路径,因此代码设计工具实际上没有提供正确的框架路径。
SOLUTION: double check you have no spaces in your path :)
解决方案:仔细检查您的路径中没有空格:)
Hope this will help somebody to save some time :)
希望这会帮助某人节省一些时间:)
回答by possen
One other thing to watch out for is if something is getting put into the output folder that should not be there or removed from that output folder. For example, in our old builds we put our documentation into the output folder that now gets signed. Now we can't do that, we have to put it alongside the signed output folder. Moving that out solved the unrecognized bundle format error. Hope this helps someone.
需要注意的另一件事是,是否将某些不应该存在或从该输出文件夹中删除的内容放入输出文件夹。例如,在我们的旧版本中,我们将文档放入现在已签名的输出文件夹中。现在我们不能这样做,我们必须把它放在签名的输出文件夹旁边。将其移出解决了无法识别的捆绑格式错误。希望这可以帮助某人。
回答by matf
I was seeing a similar issue with CocoaPods 0.39.0, in the end I solved it by modifying my pod spec:
我在 CocoaPods 0.39.0 中看到了类似的问题,最后我通过修改我的 pod 规范来解决它:
Commenting out
注释掉
s.resource_bundles = {
'DHSErdi' => ['Pod/Assets/*.png']
}
And adding this
并添加这个
s.resources = ['Pod/Assets/*.xib', 'Pod/Assets/*.png', 'Pod/Assets/*.jpg', 'Pod/Assets/*.html', 'Pod/Assets/javascript/dist/**/*.js','Pod/Assets/javascript/src/**/*.html']