【问题标题】:Cocoapods 1.1.1 target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES`Cocoapods 1.1.1 目标覆盖了`ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES`
【发布时间】:2017-03-04 14:53:42
【问题描述】:

我已经为我的 XCode 8 Swift 2.0 项目更新到 cocoapods 1.1.1,现在我在控制台中收到警告“...target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES ...”。我该如何解决这个问题?

这是我的 podfile

platform :ios, '9.0'
use_frameworks!

def app_pods
 pod 'Alamofire', '~> 4.0.0'
 pod 'AlamofireObjectMapper','~> 4.0.0'
 pod 'RealmSwift', '~> 2.0.2'
 pod 'KeychainAccess', '~> 3.0.0'
 pod 'ReachabilitySwift', '~> 3'
 pod 'SwiftyBeaver', '~> 1.0.1'
 pod 'GoogleAnalytics', '~> 3.17.0'
end

def unit_tests
 app_pods
 pod 'OHHTTPStubs', '~> 5.2.1'
 pod 'OHHTTPStubs/Swift', '~> 5.2.1'
end 


target 'Demo' do
 app_pods
end

target 'App1' do
 app_pods
end

target 'App2' do
 app_pods
end

target 'DemoTests' do
 unit_tests
end

target 'App1Tests' do
 unit_tests
end

target 'App2Tests' do
 unit_tests
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
        end
    end
end

【问题讨论】:

    标签: cocoapods cocoapods-1.1.1


    【解决方案1】:

    此问题已在以下拉取请求 https://github.com/CocoaPods/CocoaPods/pull/6068 中得到修复,它应该在 cocoapods 版本 1.1.2 中出现。我从以下 github 问题 https://github.com/CocoaPods/CocoaPods/issues/6067

    中获得了信息

    【讨论】:

      【解决方案2】:

      我可以通过执行以下操作来解决此问题:

      1. 进入构建设置
      2. 在顶部选择 AllCombined
      3. 在构建选项下,您应该会看到 始终嵌入 Swift 标准库,它是粗体的。
      4. 单击它并单击删除。它现在应该是非粗体的。
      5. Pod 安装和错误应该消失!

      因为我没有足够的声誉,它不会让我发布图像,所以这里有一个详细的屏幕截图链接!

      https://cloud.githubusercontent.com/assets/17066507/21532583/93df897e-cd1f-11e6-9f17-d25cb81a2a53.png

      【讨论】:

        【解决方案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/

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2016-07-14
          • 1970-01-01
          • 2017-05-25
          • 1970-01-01
          • 1970-01-01
          • 2016-04-15
          • 1970-01-01
          相关资源
          最近更新 更多