Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 views
in Technique[技术] by (71.8m points)

ios - Module compiled with Swift 4.1.2 cannot be imported in Swift 4.1.50: Xcode 10 Error

Swift 4.2 came out and I'm receiving this error message in my project when using ObjectMapper and some other pods too:

Module compiled with Swift 4.1.2 cannot be imported in Swift 4.1.50

So how do I tell Xcode to start updating my project and migrate it to Swift 4.2?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You are not compiling your Carthage module with the proper swift version. So you need to:

  1. Make sure your terminal is pointing to your Xcode 10 Beta app and not your regular Xcode:

sudo xcode-select -switch Xcode_beta_10.app

  1. Update your Carthage files:

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

  1. Go back to your project in Xcode, clean, build

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...