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
Target overrides the `OTHER_SWIFT_FLAGS` build setting
提问by confile
Here is my pod file:
这是我的 pod 文件:
platform :ios, '8.0'
use_frameworks!
target 'TestApp' do
...
end
After pod install
I 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
Select your project
Switch to your project 's
Build Settings
panel.Search for
Other Swift Flags
Now you may see the value of
Other Swift Flags
shows in BOLD
选择您的项目
切换到您的项目
Build Settings
面板。搜索
Other Swift Flags
现在您可能会看到BOLD
Other Swift Flags
显示的价值
(BOLDalso means this value is being overridden)
(BOLD也意味着这个值被覆盖)
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 Flags
value area and replace the value with $(inherited)
双击Other Swift Flags
值区域并将值替换为$(inherited)
Option 2:
选项 2:
Select the Other Swift Flags
panel 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
- Staging / Development
- Production
- 分期/开发
- 生产
You can add multiple swift flags in targets --> Build Settings ---> Other Swift flags.
您可以在目标 --> 构建设置 ---> 其他 Swift 标志中添加多个 swift 标志。