捆绑包格式无法识别,无效或不适合

时间:2022-10-24 00:03:52

捆绑包格式无法识别,无效或不适合

Xcode:8.1

language: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!

但那没用!

6 个解决方案

#1


7  

Are you using CocoaPods? Updating CocoaPods itself + then all the pods worked from me.

你在使用CocoaPods吗?更新CocoaPods本身+然后所有pod工作从我。

Note: this is right after the Xcode autoupdate today.

注意:这是在今天的Xcode自动更新之后。

#2


16  

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 Pods in the Project Navigator
  2. 右键单击Project Navigator中的Pods

  3. Click New File...
  4. 单击新文件...

  5. Select Property List
  6. 选择物业清单

  7. Save the file under the name Pods-Info.plist (for example) and leave it empty
  8. 将文件保存在名称Pods-Info.plist(例如)下并保留为空

  9. Select Pods in the Project Navigator
  10. 在Project Navigator中选择Pods

  11. Select the Pods project, then Build Settings
  12. 选择Pods项目,然后选择Build Settings

  13. Search for Info.plist
  14. 搜索Info.plist

  15. Set the value of Info.plist File to Pods-Info.plist
  16. 将Info.plist文件的值设置为Pods-Info.plist

#3


7  

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.

我有同样的问题。我做了以下步骤,并且它已经满足了。在导航中选择窗格 - >目标 - >您的FDTakeResources - >签名(启用开发签名) - >标识(选择Info.plist文件)。然后我可以在我的模拟器上运行它。

#4


0  

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.

这不是主题启动器的解决方案,但是在我的情况下,我在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正在使用自定义输出目录,它在中间包含空格char。 CP后期构建生成的脚本不能正确处理带空格的路径,因此代码签名工具实际上没有提供正确的框架路径。

SOLUTION: double check you have no spaces in your path :)

解决方案:仔细检查你的路径中没有空格:)

Hope this will help somebody to save some time :)

希望这会帮助别人节省一些时间:)

#5


0  

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.

另外需要注意的是,是否有东西被放入输出文件夹中,该文件夹不应存在或从该输出文件夹中删除。例如,在我们的旧版本中,我们将文档放入现在已签名的输出文件夹中。现在我们不能这样做,我们必须把它放在签名的输出文件夹旁边。移出它解决了无法识别的包格式错误。希望这有助于某人。

#6


0  

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']

#1


7  

Are you using CocoaPods? Updating CocoaPods itself + then all the pods worked from me.

你在使用CocoaPods吗?更新CocoaPods本身+然后所有pod工作从我。

Note: this is right after the Xcode autoupdate today.

注意:这是在今天的Xcode自动更新之后。

#2


16  

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 Pods in the Project Navigator
  2. 右键单击Project Navigator中的Pods

  3. Click New File...
  4. 单击新文件...

  5. Select Property List
  6. 选择物业清单

  7. Save the file under the name Pods-Info.plist (for example) and leave it empty
  8. 将文件保存在名称Pods-Info.plist(例如)下并保留为空

  9. Select Pods in the Project Navigator
  10. 在Project Navigator中选择Pods

  11. Select the Pods project, then Build Settings
  12. 选择Pods项目,然后选择Build Settings

  13. Search for Info.plist
  14. 搜索Info.plist

  15. Set the value of Info.plist File to Pods-Info.plist
  16. 将Info.plist文件的值设置为Pods-Info.plist

#3


7  

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.

我有同样的问题。我做了以下步骤,并且它已经满足了。在导航中选择窗格 - >目标 - >您的FDTakeResources - >签名(启用开发签名) - >标识(选择Info.plist文件)。然后我可以在我的模拟器上运行它。

#4


0  

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.

这不是主题启动器的解决方案,但是在我的情况下,我在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正在使用自定义输出目录,它在中间包含空格char。 CP后期构建生成的脚本不能正确处理带空格的路径,因此代码签名工具实际上没有提供正确的框架路径。

SOLUTION: double check you have no spaces in your path :)

解决方案:仔细检查你的路径中没有空格:)

Hope this will help somebody to save some time :)

希望这会帮助别人节省一些时间:)

#5


0  

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.

另外需要注意的是,是否有东西被放入输出文件夹中,该文件夹不应存在或从该输出文件夹中删除。例如,在我们的旧版本中,我们将文档放入现在已签名的输出文件夹中。现在我们不能这样做,我们必须把它放在签名的输出文件夹旁边。移出它解决了无法识别的包格式错误。希望这有助于某人。

#6


0  

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']