Reputation: 3969
I wanted to test my app using Xcode 9 beta. Now I am back to Xcode 8 and I have the following error:
Module compiled with swift 4.0 cannot be imported in swift 3.1
To solve this error I refresh all Carthage build and made some cleaning:
build
and checkout
Derived Data
directoryBut the error still here.
The command used is: 'carthage update --platform iOS'
As the problem lie on always the same framework, DeviceKit
I then manage to remove it from Cartfile
.
Project build then show errors as DeviceKit
is not found.
I then re-add it to Cartfile
and run carthage update DeviceKit --platform iOS --no-use-binaries
This related question bring answer but for Cocoapods: Module compiled with swift 4.0 cannot be imported in swift 3.1
Upvotes: 2
Views: 1885
Reputation: 3969
Solved by the following steps:
rm -rf ~/Library/Caches/org.carthage.CarthageKit/DerivedData
carthage update --platform iOS
I found the answer on the dedicated Carthage' page on GitHub: https://github.com/Carthage/Carthage/issues/2062
Upvotes: 4