以下Pod已集成到没有相同Swift版本的目标中

时间:2018-10-03 12:07:00

标签: ios swift xcode cocoapods

我最近在更新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安装”时,它会显示以下信息:

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

Podfile:

#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

1 个答案:

答案 0 :(得分:0)

就我而言,我错过了迁移其他内置目标(如单元测试和ui测试:)

相关问题