【问题标题】:What's ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES with CocoaPods, Swift 3 and Xcode 8什么是 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 与 CocoaPods、Swift 3 和 Xcode 8
【发布时间】:2017-05-25 00:36:36
【问题描述】:

在安装 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

【问题讨论】:

  • - Use the `$(inherited)` flag, or - Remove the build settings from the target. — 做其中之一。
  • d= (-_- ) 现在已经很老了,任何人都不再支持iOS 12.1或更早的read related post

标签: ios swift3 cocoapods xcode8


【解决方案1】:

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

然后突出显示“始终嵌入...”行并点击删除。这会将其更改为使用继承的属性。

即使您进行了此更改,它仍会保留在那里,但它可能会从粗体变为普通文本。如果发生这种变化,那么它就会被继承。

普通文本 = 继承。

粗体字 = 被覆盖。

【讨论】:

  • 我点击删除,没有任何改变。你能更具体一点吗?我对 iOS 开发很陌生。
  • 它将保留在那里,但它可能会从粗体变为普通文本。如果发生这种变化,那么它就会被继承。普通文本 = 继承。粗体文本 = 被覆盖。
  • 好,那么我应该为我将要制作的每个项目都这样做还是为 Cocoapods 提供全局配置?
  • @Fogmeister 为了更好地可视化继承,他还可以选择Levels 选项。这比检查文本的粗体更直观。
  • 这非常有用,很难找到那个设置。
【解决方案2】:
  1. 删除您的 Pods 文件夹
  2. 将 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 设置为 $(inherited)
  3. 运行 pod 安装

【讨论】:

    【解决方案3】:

    公认的解决方案有效,但现在您必须确保所有队友都在执行它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
    

    更多信息在这里:https://www.devsbedevin.net/cocoapods-always-embed-swift-standard-libraries/

    【讨论】:

      【解决方案4】:
      1. 转到构建设置
      2. 在顶部选择全部和组合
      3. 在构建选项下搜索“始终嵌入 Swift 标准库”
      4. 用 $(inherited) 更新其值
      5. 现在安装 pod,所有错误都会消失。

      【讨论】:

        【解决方案5】:

        我建议按照消息中的建议在安装后设置所有 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
        

        【讨论】:

        • 当时它对我有用。 Cocoapods 从那时起就进化了 ;)
        【解决方案6】:

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

        1. 转到构建设置
        2. 在顶部选择全部和组合
        3. 在 Build Options 下,您应该会看到 Always Embed Swift Standard Libraries,它是粗体的。
        4. 单击它并单击删除 (
        5. Pod 安装和错误应该消失!

        【讨论】:

        • 您能告诉我,这些是错误还是警告?我是新人,尽管 pod 已完全安装:“[!]LearningTests [Debug] 目标覆盖了在 Pods/Target Support Files/Pods-LearningTests/Pods-LearningTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` 标志中定义的 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 构建设置,或者 - 从目标中删除构建设置。” ,这是警告还是错误?豆荚安装成功了吗?
        • @ArgaPK 是的,完全按照他们的指示,他们就会离开
        • 为我工作,对于那些仍然出现错误的人,请确保对 Targets OS 和 UITests 也这样做!
        • 无法在 Xcode 11 上删除。好吧,点击 Delete 只是使它不加粗,但实际上并没有删除该属性。
        • 已经有一段时间了,但我很确定我只是点击了删除按钮。
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-02-10
        • 2016-12-19
        • 1970-01-01
        • 1970-01-01
        • 2017-03-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多