在 Xcode 8 中安装 pod 后找不到代码签名 [英] No code signature found after pod installed in Xcode 8

查看:33
本文介绍了在 Xcode 8 中安装 pod 后找不到代码签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的测试项目在我的物理设备 (iPhone) 上成功运行.但是,在我将 pod 安装到我的项目中之后.我收到错误消息,说没有找到代码签名.我找到了一些与该问题相关的文章.https://michiganlabs.com/ios/development/2015/11/30/code-sign-error-building-cocoapods-framework-targets/ 文章建议需要在pod文件中包含一些代码签名绕过

My test project running successfully in my physical device(iPhone).But, After I installed a pod into my project.I am getting error saying NO CODE SIGNATURE FOUND.I found some article related to the issue.https://michiganlabs.com/ios/development/2015/11/30/code-sign-error-building-cocoapods-framework-targets/ The article suggest that need to be include some code signing bypass to the pod file as below

  post_install do |installer|
   installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
        config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
        config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
    end
   end
 end

代码没有解决问题.提前致谢....

Code didn't fix the issue.Thanks in advance....

推荐答案

来自 Rashwan L 的回答.我试过这3个步骤.但是,它没有解决我的问题.可能它适用于不同的场景.我正在阅读同一篇文章链接在帖子中.文章提到可以通过对 pod 项目进行代码签名或绕过代码签名来解决该错误修改pod文件.

From Rashwan L answer. I tried those 3 steps. But, It didn't solved my problem.May be it could works for different scenario.I was reading the same article link is in the post.Article mentioned the error can be solved by either code signing the pod project or bypass code signing to modify the pod file.

一旦我对 pod 项目进行了代码签名.一切都开始在第一次运行...

As soon as,I code signed the pod project.Everything start working on a first go...

文章信息如下:

Swift 框架库需要代码签名,但不需要 Objective-C

进一步深入研究这个问题,我们发现新的 Swift 框架构建正确,只有预先存在的 Objective-C Pod(以前的静态库)因代码签名错误而失败.是时候打谷歌了!在对 CocoaPods GitHub 问题页面进行了大量研究并查看了最新的 iOS/OS X 依赖项管理器 Carthage 的一些类似问题后,我意识到 Objective-C 库不应该进行代码签名.Swift 框架需要代码签名,因为它们嵌入了 Swift 标准库和运行时,允许在较新的项目中使用较旧的 Swift 代码.Apple 需要代码签名来验证被复制到 iOS 应用程序的运行时代码(有助于强制执行 iOS 安全沙箱).老派的 Objective-C 静态库不需要这个,实际上甚至不支持它,因此出现关于没有签名身份匹配团队 ID(空)"的奇怪构建错误.

Digging into the problem a bit further, we discovered that the new Swift framework was building properly and just the pre-existing Objective-C Pods (formerly static libraries) were failing with the Code Sign Error. Time to hit the Google! After much research on CocoaPods GitHub Issues page and looking over some similar problems with the latest iOS/OS X dependency manager Carthage, I realized that the Objective-C libraries should NOT be getting code signed. Swift frameworks require code signing because they embed the Swift standard library and runtime, enabling use of older Swift code in a newer project. Apple requires Code Signing to verify the runtime code that’s being copied into an iOS app (helps enforce the iOS security sandbox). The old school Objective-C static libraries do not need this and actually do not even support it, hence the weird build error about "No signing identities matching team ID (null)."

解决方案 - 禁用代码签名一种解决方案是手动编辑每个 Pod 库目标并禁用代码签名.不是一个很好的选择,因为每次重新运行 pod install 时都会重新创建这些构建设置.在仔细阅读 CocoaPods 文档后,我们找到了解决方案.在将 Pod 目标保存到磁盘(并集成到 Xcode 工作区)之前修改它们的安装后"脚本.我们通过每个 Pod 依赖项的适当构建设置手动禁用代码签名.将此添加到您的 Podfile 底部,您的代码签名错误将得到解决!

The Solution - Disable Code Signing One solution would be to manually edit each Pod library target and disable Code Signing. Not a great option since those build settings will be re-created each time pod install is re-run. After perusing the CocoaPods documentation, we found the solution. A "Post Install" script that modifies the Pod targets before they are saved to disk (and integrated into the Xcode Workspace.) We manually disable Code Signing via the appropriate Build Settings for each of the Pod dependencies. Add this to the bottom of your Podfile and your Code Signing error will be resolved!

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
        config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
        config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
       end
    end
  end

我希望,这个答案会帮助某人...

I hope, This answer will helps someone...

这篇关于在 Xcode 8 中安装 pod 后找不到代码签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆