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

时间:2016-11-07 18:06:28

标签: ios xcode swift3 cocoapods

我正在将我的项目更新为Swift 3.当我将一些cocoapods更新为swift 3时,在运行pod install之后,我在终端中收到以下消息:

 Analyzing dependencies
[!] The following pods are integrated into targets that do not have the same Swift version:

- AWSCore required by myApp (Swift 3.0.1), myApptests (Swift 3.0)
- AWSS3 required by myApp (Swift 3.0.1), myApptests (Swift 3.0)
- Alamofire required by myApp (Swift 3.0.1), myApptests (Swift 3.0)

这里有一个冗长的主题:https://github.com/CocoaPods/CocoaPods/issues/5864关于这个问题,我尝试了建议的解决方案,但是当我运行pod安装时,我仍然得到相同的消息。

这是我的pod文件:

enter image description here

在一个给定链接之外,我在这个问题上找不到多少。其他人遇到过同样的问题?有解决方案吗我上周末刚刚安装了Xcode 8.1和Swift 3.0.1。

6 个答案:

答案 0 :(得分:31)

我知道这篇文章已经过时但我刚刚解决了一个最近的问题,当我用swcode4将swift3项目更新为swift4时,问题说: [!] The following pods are integrated into targets that do not have the same Swift version:

Appsee required by MyApp (Swift 4.0), MyAppUnitTest (Swift 3.0) ... Allpods

我的解决方案是: 我的主要目标MyApp的快速版本为4.0,我还将我的UnitTest版本更新为4.0 Build Settings - > Swift Language Version

答案 1 :(得分:5)

我已经解决了这个问题:

  1. 我有两个目标:主要项目和测试目标。
  2. 我的主要项目的目标是“使用旧版Swift语言版本”(在构建设置中)为“未指定(3.0)”。
  3. 我将'使用遗留的Swift语言版本'设置为'否',它运行良好。

答案 2 :(得分:4)

Xcode 9这个问题变得更糟,因为它支持3.2和4.0 swift版本,但Cocoa Pods还不支持这个:

[!] The following pods are integrated into targets that do not have the same Swift version:
- XCGLogger required by target1 (Swift 4.0), target2 (Swift 3.0)

解决方法:暂时将target1切换到swift 3.2,安装可可豆荚,然后将其切换回swift 4.0。

答案 3 :(得分:3)

当我打开xcodeproj文件时,显示3.2,但当我运行git diff时,我注意到project.pbxproj的所有内容都是Swift 3.0。

使用文本编辑器手动将SWIFT_VERSION变量更新为3.2解决了这种差异。

我推荐这只是最后的手段!

答案 4 :(得分:1)

对于CocoaPods App v.1.1.1,通过在Use legacy Swift Language Version部分中为所有目标设置UnspecifiedBuild Settings来解决此问题。

可能这是一个应用程序错误 - 所有目标都有相同的设置,但CocoaPods应用只抱怨其中一个。

UPD :为了能够编译项目,我必须将其从Unspecified更改为No

答案 5 :(得分:1)

我遇到了一个目标的问题,差异在3.0到3.0.1

我通过手动编辑项目文件(project.pbxproj)并更改3.0来解决它;用3.0.1;