【问题标题】:The following pods are integrated into targets that do not have the same Swift version以下 pod 被集成到没有相同 Swift 版本的目标中
【发布时间】:2018-10-03 12:06:59
【问题描述】:

我最近在更新 Xcode 后遇到了一个问题,我无法构建项目。

Multiple commands produce '/Users/username/Library/Developer/Xcode/DerivedData/appname-code/Build/Products/Release-iphoneos/appname.app':

我按照这些答案中的说明进行操作: https://stackoverflow.com/a/52452590/4838107 https://stackoverflow.com/a/35316717/4838107

$ sudo gem install cocoapods-deintegrate
$ sudo gem install cocoapods-clean
$ pod deintegrate
$ pod clean
$ pod install

当我尝试“pod install”时,它给了我这个:

The following pods are integrated into targets that do not have the same Swift version:
Alamofire required by [target] (Swift 3.0)

我无法再打开该项目,因为 .xcworkspace 已消失,因此任何涉及在 Xcode 中打开该项目的解决方案都将没有任何用处。我在 stackoverflow 上搜索了答案,这是一个问题,例如 here。

Pod 文件:

#Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO'
            config.build_settings['EMBEDDED_CONTENT_CONTAINS_SWIFT'] = 'NO'
        config.build_settings['SWIFT_VERSION'] = '3.0.1'
        end
    end
end
def standard_pods
    pod 'Alamofire'
    ...
end


target '[target]' do
    standard_pods
end

【问题讨论】:

  • 在 Podfile 中指定适用于您的应用正在使用的版本的 pod 版本
  • @AshleyMills 我编辑了我的问题
  • 您是否尝试过指向旧版本的 Alamofire pod?为 Swift 3 构建的?
  • 我有 13 个豆荚。我会手动查找所有这些,还是有办法自动查找?
  • 您需要手动完成,但这不是一项大工作。只需检查 GitHub 上的 Releases 选项卡。当然,您将失去 Pod 的任何新功能。或者,将您的应用更新到 Swift 4。您迟早必须这样做。

标签: ios swift xcode cocoapods


【解决方案1】:

就我而言,我错过了迁移其他构建目标,例如单元测试和 ui 测试 :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-19
    • 2021-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多