什么是CocoaPods,Swift 3和Xcode 8的ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

Moh*_*ain 47 ios cocoapods swift3 xcode8

安装cocoapods并添加pod "SwiftCarousel"到pod文件并取消注释平台之后:ios,'9.0'我得到了这个错误

ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

我该怎么办?

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
Run Code Online (Sandbox Code Playgroud)

Fog*_*ter 93

在构建设置中转到此处...

在此输入图像描述

然后突出显示"Always embed ..."行并点击删除.这将改变它以使用继承的属性.

  • 它将保留在那里,但它可能会从粗体文本变为普通文本.如果发生了这种变化,那么它就会被继承.普通文本=继承.粗体文字=被覆盖. (17认同)
  • 我点击了删除,但没有任何改变。您能说得更具体一点吗?我对 iOS 开发非常陌生。 (3认同)

Mar*_*uiz 28

我能够通过执行以下操作来解决此问题(一步一步):

  1. 转到构建设置
  2. 在顶部选择全部和组合
  3. 在Build Options下,您应该看到Always Embed Swift标准库,它是粗体.
  4. 单击它并单击删除(< - ).它现在应该是不受约束的.(普通文本=继承)
  5. Pod安装和错误/错误应该消失!

在此输入图像描述

  • 你能告诉我,这些是错误还是警告?我是新手,尽管 Pod 已完全安装:“[!] `LearningTests [Debug]` 目标覆盖了 `Pods/Target Support Files/Pods-LearningTests/Pods-LearningTests.debug.xcconfig' 中定义的 `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` 构建设置. 这可能会导致 CocoaPods 安装出现问题 - 使用 `$(inherited)` 标志,或者 - 从目标中删除构建设置。” ,这是警告还是错误?pods 安装成功了吗? (2认同)
  • 为我工作,对于仍然出现错误的所有人员,请确保也对Targets OS和UITests执行此操作! (2认同)

erg*_*cak 7

我建议按照消息中的建议在安装后设置所有 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
Run Code Online (Sandbox Code Playgroud)


Uma*_*Ali 7

  1. 转到构建设置
  2. 在顶部选择全部和合并
  3. 在“生成选项”下搜索“始终嵌入Swift标准库”
  4. 用$(继承)更新其值
  5. 现在安装pod,所有错误都应该消除。

在此处输入图片说明


Vai*_*den 6

公认的解决方案有效,但是现在您必须确保所有队友都在执行它pod install。

我们都知道他们不会。

通过将其添加到您的底部,可以使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
Run Code Online (Sandbox Code Playgroud)

此处提供更多信息:https : //www.devsbedevin.net/cocoapods-always-embed-swift-standard-libraries/