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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 11:02:26  来源:igfitidea点击:

What's ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES with CocoaPods, Swift 3 and Xcode 8

iosswift3cocoapodsxcode8

提问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

Go here in your build settings...

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

enter image description here

在此处输入图片说明

And then highlight the "Always embed..." row and hit delete. This will change it to use the inherited property.

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

回答by Marlon Ruiz

I was able to fix this problem by doing the following (step by step):

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

  1. Go to Build Settings
  2. At the top select All and Combined
  3. Under Build Options you should see Always Embed Swift Standard Libraries and it is bold.
  4. Click on it and click delete (<-). It should now be unbolded. (Normal text = inherit)
  5. Pod install and the error/errors should go away!
  1. 转到构建设置
  2. 在顶部选择全部和组合
  3. 在 Build Options 下,您应该看到 Always Embed Swift Standard Libraries 并且它是粗体的。
  4. 单击它并单击删除 (<-)。现在应该取消加粗。(普通文本 = 继承)
  5. Pod 安装和错误/错误应该消失!

enter image description here

在此处输入图片说明

回答by Umair Ali

  1. Go to Build Settings
  2. At the top select All and Combined
  3. Under Build Options search "Always Embed Swift Standard Libraries"
  4. Update its value with $(inherited)
  5. Now install pod and all the error should go.
  1. 转到构建设置
  2. 在顶部选择全部和组合
  3. 在构建选项下搜索“始终嵌入 Swift 标准库”
  4. 用 $(inherited) 更新它的值
  5. 现在安装 pod,所有错误都应该消失。

enter image description here

在此处输入图片说明

回答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

  1. Deleteyour Pods folder
  2. set the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to $(inherited);
  3. run pod install
  1. 删除您的 Pods 文件夹
  2. 将 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 设置为$(inherited)
  3. 运行pod 安装