IBDesignables,找不到合适的图像,缺少所需的代码签名

IBDesignables, no suitable image found, required code signature missing

我最近对 ​​Assets.xcassets 进行了一些更改,这给 XCode 带来了绝对的混乱。我最终遇到了多个此类错误:Failed to render and update auto layout status for *MyViewController* (6jf-cd-DYU) dlopen (AFramework.framework, 1): no suitable image found. Did find: Aframework.framwork: required code signature missing for 'Aframework.framework' in both both .storyboard and .xib files.

Aframework 是我作为依赖项的多个 Pod 框架的占位符。在我修改 xcassets 之前,这些工作正常。

我尝试了所有我能找到的与此相关的方法,但我一无所获:清理派生数据,运行 clean/build,删除所有 XCode 缓存文件夹,重新安装 XCode 完全刷新所有视图等。它编译并运行良好,应用程序中的一切正常(并且没有图像或资源丢失),但我所有的故事板都是空白的(全白),这使得它很难工作。

我也尝试了 pod deintegrate,删除了 xcworkspace 文件并重新安装 pods(因为错误指向 Pod 框架)。我还通过 XCode 撤销并重新颁发了我的所有证书,因为它指出代码签名是一个问题。

编辑:我完全重新安装了 OSX 并从工作配置中从 Git 克隆了 repo。没变化。这一定不是 xcassets 理论,因为即使我检查了几周前的提交(我确定这不是问题),我仍然会收到错误。也许从现在到上次它工作之间,Apple 更新了一些东西。我已经放弃了,现在继续前进。我将只单击左侧资源管理器中的视图,而不是在情节提要中单击。希望某个地方有人能在某个时候解决这个问题。

原来这与椰子类动物有关。 1.5 似乎与 XCode 9.3 有问题。我降级到 cocoapods 1.4,问题就消失了。请参阅 this thread on GitHub

编辑:此问题已修复。最新版本的CocoaPods已经没有这个问题了,你只需要更新即可。

这个问题看起来像 Cocoapods 错误,是由 Pods 设置中的 CODE_SIGNING_ALLOWEDCODE_SIGNING_REQUIRED 键引起的。

在 pod 文件末尾添加此代码将解决一个问题(不要忘记然后 pod install):

# Workaround for Cocoapods v.1.5 issue #7606
post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings.delete('CODE_SIGNING_ALLOWED')
        config.build_settings.delete('CODE_SIGNING_REQUIRED')
    end
end

只需添加 Igor 答案的完整版本

请不要降级 cocoapods。改为如下修改 pod 文件。

#Replace 9.0 with your project ios version
platform :ios, '9.0'

target 'YourProject' do

frameworks
  use_frameworks!

  pod 'Alamofire', '~> 4.7'
  pod 'AlamofireObjectMapper', '~> 5.0'
  pod 'SDWebImage', '~> 4.0'

end

post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings.delete('CODE_SIGNING_ALLOWED')
        config.build_settings.delete('CODE_SIGNING_REQUIRED')
    end
end