【问题标题】:Target overrides the `OTHER_SWIFT_FLAGS` build settingTarget 会覆盖“OTHER_SWIFT_FLAGS”构建设置
【发布时间】:2015-09-20 19:39:42
【问题描述】:

这是我的 pod 文件:

platform :ios, '8.0'
use_frameworks!

target 'TestApp' do
  ...
end

pod install之后出现以下错误:

[!] The `TestApp [Debug]` target overrides the `OTHER_SWIFT_FLAGS` build setting defined in `Pods/Target Support Files/Pods-TestApp/Pods-TestApp.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `TestApp [Release]` target overrides the `OTHER_SWIFT_FLAGS` build setting defined in `Pods/Target Support Files/Pods-TestApp/Pods-TestApp.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target. 

我该如何解决这个问题?

【问题讨论】:

  • 你有什么问题?您是否尝试按照它给您的说明进行操作?
  • 我不知道在这里做什么。你能帮忙吗?

标签: ios xcode cocoapods


【解决方案1】:
  1. 选择您的项目

  2. 切换到项目的Build Settings 面板。

  3. 搜索Other Swift Flags

  4. 现在您可以看到Other Swift Flags 的值以BOLD

  5. 显示

BOLD也意味着这个值被覆盖了)

作为终端显示的警告:

使用$(inherited) 标志,或 - 从目标中删除构建设置。

你可以通过以下两种方式让编译器满意:

选项1:

双击Other Swift Flags值区域,将值替换为$(inherited)

选项 2:

选择Other Swift Flags 面板使其突出显示。然后按键盘上的Delete按钮,现在字体将变为THIN,而不是BOLD

【讨论】:

  • 也适用于ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 设置。
  • 也适用于Use Legacy Swift Language Version :)
  • 好吧,我会说这解决了这个特定的警告,但如果(现已删除)swift标志已被使用,可能会产生许多其他问题。只是盲目地删除它们并不是处理此问题的一般方法。如果这些值用于条件编译(如 DEBUG 或 RELEASE),则可以将这些值移至“活动编译条件”构建设置。
  • 第三种选择是添加 $(inherited) 标志作为附加标志,而不是在需要维护现有自定义标志时替换,
  • 这个:(双击 Other Swift Flags 值区域并用 $(inherited) 替换该值) 当我从 XCode 3 转换到 Xcode 4.2 时遇到问题时,它对我有用在使用 cocoapods 的项目中
【解决方案2】:

我也有同样的问题,我必须使用多个目标和 cocoapods

  1. 分期/开发
  2. 生产

您可以在目标中添加多个 swift 标志 --> 构建设置 ---> 其他 Swift 标志。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-20
    • 2023-04-06
    • 2014-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多