ios CocoaPods、Swift 3 和 Xcode 8 的 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 是什么
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41570233/
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
What's ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES with CocoaPods, Swift 3 and Xcode 8
提问by Mohammad Eliass Alhusain
after installing cocoapods and adding pod "SwiftCarousel"
to pod file and uncomment the platform :ios, '9.0' I got this ERROR
安装 cocoapods 并添加pod "SwiftCarousel"
到 pod 文件并取消注释平台后:ios, '9.0' 我收到此错误
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
and what should I do?
我该怎么办?
mohammed.elias$ pod install
Analyzing dependencies
Downloading dependencies
Installing SwiftCarousel (0.8.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `scrollView.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] The `scrollViewTests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewTests/Pods-scrollViewTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `scrollViewTests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewTests/Pods-scrollViewTests.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `scrollViewUITests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewUITests/Pods-scrollViewUITests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `scrollViewUITests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewUITests/Pods-scrollViewUITests.release.xcconfig'. This can lead to problems with the CocoaPods installation
回答by Fogmeister
回答by Marlon Ruiz
I was able to fix this problem by doing the following (step by step):
通过执行以下操作(逐步),我能够解决此问题:
- Go to Build Settings
- At the top select All and Combined
- Under Build Options you should see Always Embed Swift Standard Libraries and it is bold.
- Click on it and click delete (<-). It should now be unbolded. (Normal text = inherit)
- Pod install and the error/errors should go away!
- 转到构建设置
- 在顶部选择全部和组合
- 在 Build Options 下,您应该看到 Always Embed Swift Standard Libraries 并且它是粗体的。
- 单击它并单击删除 (<-)。现在应该取消加粗。(普通文本 = 继承)
- Pod 安装和错误/错误应该消失!
回答by Umair Ali
回答by Vaiden
The accepted solution works, but now you have to make sure all of your teammates are performing it each pod install
.
公认的解决方案有效,但现在您必须确保您的所有队友都在执行它pod install
。
And we all know they won't.
我们都知道他们不会。
You could make CococaPods do it automatically, by adding this to the bottom of your Podfile
:
你可以让 CococaPods 自动执行,方法是将它添加到你的底部Podfile
:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.name == 'MyPOD'
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'Yes'
end
end
end
end
More info here: https://www.devsbedevin.net/cocoapods-always-embed-swift-standard-libraries/
更多信息在这里:https: //www.devsbedevin.net/cocoapods-always-embed-swift-standard-libraries/
回答by ergunkocak
I suggest to set all pods after install as suggested in the message:
我建议按照消息中的建议在安装后设置所有 pod:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = '$(inherited)'
end
end
end
回答by Santiago
- Deleteyour Pods folder
- set the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to $(inherited);
- run pod install
- 删除您的 Pods 文件夹
- 将 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 设置为$(inherited);
- 运行pod 安装