xcode 目标覆盖 `OTHER_SWIFT_FLAGS` 构建设置

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

Target overrides the `OTHER_SWIFT_FLAGS` build setting

iosxcodecocoapods

提问by confile

Here is my pod file:

这是我的 pod 文件:

platform :ios, '8.0'
use_frameworks!

target 'TestApp' do
  ...
end

After pod installI get the following errors:

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. 

How do I resolve this problem?

我该如何解决这个问题?

回答by Zigii Wong

  1. Select your project

  2. Switch to your project 's Build Settingspanel.

  3. Search for Other Swift Flags

  4. Now you may see the value of Other Swift Flagsshows in BOLD

  1. 选择您的项目

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

  3. 搜索 Other Swift Flags

  4. 现在您可能会看到BOLDOther Swift Flags显示的价值

(BOLDalso means this value is being overridden)

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

enter image description here

在此处输入图片说明

As the warnings showing in terminal:

正如终端中显示的警告:

Use the $(inherited)flag, or - Remove the build settings from the target.

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

You can make the compiler happy in these two ways:

您可以通过以下两种方式使编译器满意:

Option 1:

选项1:

Double click the Other Swift Flagsvalue area and replace the value with $(inherited)

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

Option 2:

选项 2:

Select the Other Swift Flagspanel to make it highlight. Then press the DeleteButton in your keyboard and now the font will become THIN, instead of BOLD.

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

回答by Abhijit Hadkar

I also had same problem where I have to use multiple targets and cocoapods

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

  1. Staging / Development
  2. Production
  1. 分期/开发
  2. 生产

You can add multiple swift flags in targets --> Build Settings ---> Other Swift flags.

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