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


70

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

1
- Use the `$(inherited)` flag, or - Remove the build settings from the target.-做任何一个。
user28434

Answers:


131

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

在此处输入图片说明

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

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

普通文字=继承。

粗体=覆盖。


1
我点击了删除,但没有任何更改。请问您具体些吗?我对iOS开发非常陌生。
Mohammad Eliass Alhusain

27
它会保留在那里,但可能会从粗体变为普通文本。如果发生这种更改,那么它将被继承。普通文字=继承。粗体=覆盖。
Fogmeister

好的,那我应该为每个我要做的项目做这些工作,还是对Cocoapods进行全局配置?
Mohammad Eliass Alhusain

1
@Fogmeister为了更好地可视化继承,他还可以选择Levels选项。比检查文本的粗体性更直观。
user28434

这非常有帮助,很难找到该设置。
罗布·诺巴克

46

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

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

在此处输入图片说明


2
您能告诉我这些错误或警告吗?我是新手,尽管吊舱已完全安装:“ [!]LearningTests [Debug]目标将覆盖$(inherited)`标志中ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES定义的构建设置Pods/Target Support Files/Pods-LearningTests/Pods-LearningTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the ,或者-从目标中删除构建设置。” ,这是警告还是错误?吊舱安装成功吗?
ArgaPK

@ArgaPK是的,完全按照他们的指示去吧
Ryan Brodie

3
为我工作,对于仍然出现错误的所有人员,请确保也对Targets OS和UITests执行此操作!
Manesh

无法在Xcode 11上删除。好吧,在Delete上单击只会使其变粗,但实际上并没有删除该属性。
Zorayr

已经有一段时间了,但是可以肯定的是我只是点击了Delete按钮。
祖拉尔

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

在此处输入图片说明


11

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


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

3
  1. 删除您的Pods文件夹
  2. 将ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES设置为$(继承)
  3. 运行pod install
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.