Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

following pods are integrated into targets that do not have the same Swift version

I am updating my project to Swift 3. When updating some of my cocoapods to swift 3, I receive the following message in terminal, after running 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)

There is a lengthy thread here: https://github.com/CocoaPods/CocoaPods/issues/5864 about the issue, and I tried the proposed solution, but when I run pod install, i still get the same message.

Here is my pod file:

enter image description here

outside the one given link i haven't found much on this issue. Anyone else experienced the same problem? Any solutions? I just installed Xcode 8.1 and Swift 3.0.1 last weekend.

like image 343
jjjjjjjj Avatar asked Nov 07 '16 18:11

jjjjjjjj


People also ask

What is a pod in Swift?

What is it and what does it do? Cocoapods is an application level dependency manager that runs on objective-c, swift, and any other programming languages that run on Objective-C. It focuses on source-based distribution of third party code and allows automatic integration to your Xcode projects.


3 Answers

I just solved a recent issue when I updated my swift3 project to swift4 one with Xcode9, the problem said: [!] 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

My solution was: With my main target MyApp with the swift version at 4.0, I also updated my UnitTest version to 4.0 into Build Settings --> Swift Language Version

like image 69
DariusV Avatar answered Oct 24 '22 19:10

DariusV


This problem gets worse with Xcode 9 since it supports both 3.2 and 4.0 swift versions, but Cocoa Pods doesn't support this yet:

[!] 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)

Workaround: switch target1 to swift 3.2 temporarily, install cocoa pods, then switch it back to swift 4.0.

like image 6
Alexander Vasenin Avatar answered Oct 24 '22 18:10

Alexander Vasenin


I have solved the problem like this:

  1. I had two targets: the main project and the tests targets.
  2. My main project's target had the 'Use legacy Swift Language version' (in Build Settings) to 'Unspecified (3.0)'.
  3. I set the 'Use legacy Swift Language version' to 'No' and it worked fine.
like image 5
vbgd Avatar answered Oct 24 '22 18:10

vbgd