Error Swift Objectmapper 3.2

Asked

Viewed 114 times

0

I’m trying to update my app to iOS 11, but the framework Objectmapper is giving this error message.

Module Compiled with Swift 3.1 cannot be Imported in Swift 3.2: /Users/Dev/Documents/Development/Projects/Travellinkcore/Carthage/Build/iOS/Objectmapper.framework/Modules/Objectmapper.swiftmodule/arm64.swiftmodule

Does anyone know of any update of Framework or something like that?

2 answers

0

I may be wrong, but in general this error is corrected by giving a Product -> Clean and then a Build. It happened to me a lot when I migrated a project from Xcode 8 to 9 and had an old build from Xcode 9. If not solved I think it’s worth accessing your project folder from the command line and using these two commands:

pod repo update
pod install

They ensure that your cocoapods is with the updated repositories and that your project has the latest version of the objectmapper and the other pods (unless you specified otherwise in the Podfile, of course).

  • This works if you are using CocoaPods to manage dependencies or is doing manuel integration, in the case of Carthage needs to be the way explained in my reply.

0


Apparently you are using Carthage. Then you need to recompile the modules using the Swift 4 compiler, even if it is in 3.2 mode.

First you must configure the compiler for the toolchain of Xcode 9, using the following command on the terminal:

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer

Note that you must pass the path to where you saved the Xcode-Beta.

After that you can build the framework in question using:

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

This command will compile the framework using the toolchain defined in step 1. It may be a little slow, but after that your project should work smoothly.

Note

To return to toolchain standard execute command on terminal:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Answer adapted from this in OS English.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.