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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:30:45  来源:igfitidea点击:

bundle format unrecognized, invalid, or unsuitable

iosxcode

提问by fzh

enter image description here

在此处输入图片说明

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 的人来说,这里有一个对我有用的解决方案:

  1. Right click on Podsin the Project Navigator
  2. Click New File...
  3. Select Property List
  4. Save the file under the name Pods-Info.plist(for example) and leave it empty
  5. Select Podsin the Project Navigator
  6. Select the Podsproject, then Build Settings
  7. Search for Info.plist
  8. Set the value of Info.plist Fileto Pods-Info.plist
  1. Pods在项目导航器中右键单击
  2. 点击 New File...
  3. 选择 Property List
  4. 以名称Pods-Info.plist(例如)保存文件并将其留空
  5. Pods在项目导航器中选择
  6. 选择Pods项目,然后Build Settings
  7. 搜索 Info.plist
  8. 将值设置Info.plist FilePods-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']