ios 代码签名错误:包格式无法识别、无效或不合适

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29271548/
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-08-31 05:20:54  来源:igfitidea点击:

Code sign error : bundle format unrecognized, invalid, or unsuitable

iosswiftios8xcode6code-signing

提问by Adithya

Im working on an iOS app, Swift language, iOS8, Xcode 6.1. It was running fine on the iPad. Then I added a "Resource" folder reference to the project, after which I am getting the Code sign error.

我正在开发 iOS 应用程序、Swift 语言、iOS8、Xcode 6.1。它在 iPad 上运行良好。然后我添加了对项目的“资源”文件夹引用,之后我收到代码签名错误。

The Resource folder contains some HTML files. I am not sure how this folder reference is causing this problem. Any help please?

Resource 文件夹包含一些 HTML 文件。我不确定这个文件夹引用是如何导致这个问题的。请问有什么帮助吗?

enter image description here

在此处输入图片说明

回答by Adithya

OK, solved it, This answerhelped me.

好的,解决了,这个答案帮助了我。

I renamed the folder. Apparently Xcode does not like "Resources" file to be created manually.

我重命名了文件夹。显然 Xcode 不喜欢手动创建“资源”文件。

回答by Scriptable

I have had this issue in two different projects, I done alot of the suggested stuff, cleared the DerivedData folder, re-installed pods etc.

我在两个不同的项目中遇到过这个问题,我做了很多建议的东西,清除了 DerivedData 文件夹,重新安装了 pods 等。

In both projects it was complaining about a particular Pod and being unable to codesign it.

在这两个项目中,它都在抱怨某个特定的 Pod 并且无法对其进行协同设计。

What fixed it for me was:

为我修复的是:

  1. Select the Pods Project
  2. In the main editor window, select the Pod in the targets dropdown
  3. Under the general tab, and under the identity header, click choose Info.plist file
  4. Select the plist file for the Pod
  1. 选择 Pods 项目
  2. 在主编辑器窗口中,在目标下拉列表中选择 Pod
  3. 在常规选项卡下,在身份标题下,单击选择 Info.plist 文件
  4. 选择 Pod 的 plist 文件

The project should now build. For some reason it seems to lose this setting, or not be able to reference it's own plist file.

该项目现在应该构建。出于某种原因,它似乎丢失了这个设置,或者无法引用它自己的 plist 文件。

This worked for me in both projects. Not 100% sure why, but I hope it helps someone else having the same issue.

这在两个项目中都对我有用。不是 100% 确定为什么,但我希望它可以帮助其他有同样问题的人。

回答by Shanmugaraja G

I have the same issue for some hours. But the following helped me.

我有几个小时同样的问题。但以下帮助了我。

  1. Delete Derived data
  2. Clean the project
  1. 删除派生数据
  2. 清理项目

Then running again, worked.

然后再次运行,工作。

回答by JP Illanes

Just in case someone else is having this issue: Make sure you didn't add a Static Frameworkinto the "Embedded Binaries" section, only Dynamic Frameworks are required to be there.

以防万一其他人遇到此问题:确保您没有将静态框架添加到“嵌入式二进制文件”部分,那里只需要动态框架。

回答by William Entriken

Clean Build Folder fixed this for me.

Clean Build Folder 为我解决了这个问题。

回答by Kuldeep Kumar

Happened with me after a week of updating to Xcode 8.1, turns out I had to update cocoapods (sudo gem update cocoapods) and do pod install again to get it working.

在更新到 Xcode 8.1 一周后发生在我身上,结果我不得不更新 cocoapods (sudo gem update cocoapods) 并再次执行 pod install 以使其正常工作。

回答by Zain Ullah Muhammad

for me the problem was, in the info.plist, i forgot to update the url scheme to new bundle id

对我来说,问题是,在 info.plist 中,我忘记将 url 方案更新为新的 bundle id

previous : com.test.app new : com.test.app1

上一个:com.test.app 新:com.test.app1

this fixed the problem

这解决了问题

回答by Omar

solved here

在这里解决

  • make sure all frameworks used added to Embed Frameworks section in in build phases
  • keep copy only when installing CHECKED on same section
  • 确保在构建阶段将所有使用的框架添加到嵌入框架部分
  • 仅在同一部分安装 CHECKED 时保留副本

good luck

祝你好运

回答by Avtar Guleria

Addition to accepted answer I thought I should add this-

除了接受的答案,我想我应该添加这个 -

For me I am getting this error because Xcode-8 is actually using Test Target while running app on device. So if its the same then follow these steps:

对我来说,我收到此错误是因为 Xcode-8 在设备上运行应用程序时实际上正在使用测试目标。因此,如果相同,请按照以下步骤操作:

Go to Edit Scheme in xcode -> In Build Target -> Remove MyProject.xctest completely or uncheck all the boxes of MyProject.xctest Analyze , Test etc..

转到 xcode 中的 Edit Scheme -> In Build Target -> Remove MyProject.xctest 或取消选中 MyProject.xctest 分析、测试等的所有框。

Clean your project and then Run on the device.

清理您的项目,然后在设备上运行。

PS: Answer is from this Link

PS:答案来自此链接

回答by Vaiden

Problem started after upgrading to Xcode 8.1. My project utilizes CocoaPods. I had to delete the ./Podsdir and run pod installand pod update(which updated Flurry-iOS-SDK to 7.8.1). Why? Because reasons.

升级到 Xcode 8.1 后出现问题。我的项目使用 CocoaPods。我不得不删除./Pods目录并运行pod installpod update(将 Flurry-iOS-SDK 更新到 7.8.1)。为什么?因为原因。