ios-使用CocoaPods,Swift 3和Xcode 8的ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

在安装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
5个解决方案
92 votes

在构建设置中进入此处...

enter image description here

然后突出显示“始终嵌入...”行,然后单击删除。 这将更改它以使用继承的属性。

Fogmeister answered 2020-07-05T23:27:34Z
26 votes

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

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

enter image description here

Marlon Ruiz answered 2020-07-05T23:28:16Z
7 votes
  1. 转到构建设置
  2. 在顶部选择全部和合并
  3. 在构建选项下搜索“始终嵌入Swift标准库”
  4. 用$(继承)更新其值
  5. 现在安装pod,所有错误都应该消除。

enter image description here

Umair Ali answered 2020-07-05T23:28:53Z
4 votes

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

我们都知道他们不会。

通过将其添加到Podfile的底部,可以使CococaPods自动执行此操作:

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

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

Vaiden answered 2020-07-05T23:29:26Z
2 votes

我建议按照消息中的建议在安装后设置所有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
ergunkocak answered 2020-07-05T23:29:46Z
translate from https://stackoverflow.com:/questions/41570233/whats-always-embed-swift-standard-libraries-with-cocoapods-swift-3-and-xcode-8