2
votes

I am using carthage v0.18 on mac 10.12 (Sierra).

Cartfile:

github "ReactiveCocoa/ReactiveCocoa

I got error:

Module compiled with Swift 2.3 cannot be imported in Swift 3.0:

Do you have any idea how to fix it?

2

2 Answers

3
votes

solution

When specifying a dependency without version requirement in a Cartfile, Carthage would checkout the latest release (taken by a git tag).

To find out the latest release of ReactiveCocoa repo, go to releases page. As of writing this (September, 16, 2016), the latest release is v4.2.2.

The 4.2.2 supports Swift 2.3.

However, the work to support Swift 3 is in progress and is being constantly committed to master. Thus, your change to Cartfile works.

recommendation

During this stage (while there is no release with Swift 3 support) I would suggest you to lock your work toward the particular commit (see the format below). In this way, you would not accidentally, update the dependancy, while adding others, for example.

github "ReactiveCocoa/ReactiveCocoa" "some-commit" # some commit hash

When you are ready to check out the new changes from ReactiveCocoa repo, you could replace the version requirement with "master" and hit carthage update.

This is how I worked on Giraffe during Xcode 8 & Swift 3 betas time.

2
votes

I fixed it by adding 'master' on the end in cartfile:

github "ReactiveCocoa/ReactiveCocoa" "master"