0

Currently I have two Xcode version 10.2 and 11.1.

One Carthage update, build is failing with following error.

I have checked Carthage logged . It is showing following error.

I have tried different commands as follows

carthage update --platform iOS --no-use-binaries

carthage update --platform iOS --verbose

I am not able to build the project successfully getting following error.

Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler

All helps are appreciated.

ketaki Damale
  • 634
  • 7
  • 25

1 Answers1

0

You mention that you have two versions of Xcode installed, so my guess is that you/Carthage are trying to build using the "wrong" version of Xcode.

You can see which version of Xcode is being used for command line tools (which is what Carthage uses for building) in (at least) two ways

Command Line

Typing this command in the terminal:

xcode-select -p

Will give you the location of the Xcode version currently being used. For instance:

/Applications/Xcode.app/Contents/Developer

if your command line tools are set to use the default Xcode

To change to a different version of Xcode you can use this command

sudo xcode-select -s path-to-xcode-you-would-like-to-use/Contents/Developer

In Xcode

Open Preferences and select the "Locations" tab.

enter image description here

Here you can see and change which version of Xcode is being used for command line tools under "Command Line Tools".

Try changing the version and see if that doesn't help you.

pbodsk
  • 6,787
  • 3
  • 21
  • 51
  • I had tried with both command line tools, but no luck. still getting error – ketaki Damale Dec 06 '19 at 05:43
  • OK. Then try opening the project giving you problems in Xcode and see if you can get more info when building it yourself. Carthage downloads the code and stores it in Carthage/Checkouts so you can open the project from there and build it just like any other project – pbodsk Dec 06 '19 at 06:31