更新到Xcode 8后的错误:"没有这样的模块"和"目标覆盖`EMBEDDED_CONTENT_CONTAINS_SWIFT`build设置"

Que*_*ner 69 xcode ios cocoapods swift xcode8

No such module当我尝试构建项目时,我正在寻找Pods.如果我删除期望这个Pod的代码,另一个'没有这样的模块'会出现另一个Pod,这意味着每个Pod都必须受到影响.当我输入时,pod install我收到以下消息:

[!] The X target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `X’. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

[!] The `X` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `X'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Run Code Online (Sandbox Code Playgroud)

我为我的应用程序的调试和发布版本以及两个测试获得了这些,所以总共有12条消息.

我已经设置Always Embed Swift Standard LibrariesEMBEDDED_CONTENT_CONTAINS_SWIFTNOYES无论是在我的构建设置,这什么也没做.我还将以下代码添加到我的Podfile中,它也不起作用:

post_install do |installer|
installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO'
    end
end
end
Run Code Online (Sandbox Code Playgroud)

小智 145

[!] The `X` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `X'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Run Code Online (Sandbox Code Playgroud)

我今天遇到了这个问题.我解决了

  1. 转到项目/目标 - > [项目名称] - >构建设置.
  2. 搜索"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES"
  3. 单击Debug右侧,选择'Other',输入"$(inherited)"
  4. 与"发布"相同并安装您的pod

您可以按照下面的图片.


在此输入图像描述

  • 我总是`不 - $(继承)`我不能把它设置为`YES- $(继承)`就像截图 (10认同)
  • @Chlebta,也发生在我身上,但那是因为我在`Project`部分下设置`$(继承)`而不是在`Targets`部分下面(如Projects&Targets列表中的快照所示) ).另外,如果没有设置正确的"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES"变量,cocoapods仍然会给我警告. (3认同)
  • 我试图这样做,但错误"没有这样的模块"仍然出现 (2认同)

ask*_*boe 21

运行时看到的错误pod install不应导致No such module错误.所以我的猜测是这些错误是无关的.


要摆脱pod install错误:

发生这种情况是因为您在构建设置中定义了一个标志,该标志将覆盖CocoaPods设置的标志.如果将其设置为YES或者无关紧要NO,它仍将覆盖CocoaPods中的设置.

解决这个问题:

  1. 转到项目/目标 - > [项目名称] - >构建设置.
  2. 查找并单击相关设置(您可以使用右上角的搜索框).
  3. Backspace删除设置.

您应该看到设置从粗体字体变为普通字体.这意味着该设置已被删除,而是使用默认值.

对每个标志重复一次,给出错误,然后重新运行pod install以验证它是否有效.


No such module错误原因:

有很多方法可以发生此错误.您是否查看了这些答案,看看是否适用于您的案例?如果您报告,那将更容易为您提供帮助.

  1. Xcode:"没有这样的模块"错误,但框架就在那里
  2. Xcode 7 beta 2上的"没有这样的模块"


Ben*_*erd 5

(自2018年7月29日起更新)

  1. 项目/目标 - >项目名称 - >构建设置
  2. 构建选项
  3. 单击Always Embed Swift标准库,使其突出显示
  4. 按键盘上的删除按钮

总是嵌入雨燕标准库不应该再大胆,并执行荚更新或吊舱时,您将不再收到此警告安装=)