Error ObjectMapper Swift 3.2

0

I'm trying to upgrade my application to iOS 11, but the ObjectMapper framework is giving this error message.

  

Module compiled with Swift 3.1 can not 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 Framework upgrade or something?

    
asked by anonymous 21.08.2017 / 21:43

2 answers

0

Apparently you're using Carthage . So you need to recompile the modules using the Swift 4 compiler, even in 3.2 mode.

You should first configure the compiler for the toolchain of Xcode 9, using the following command in the terminal:

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

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

After this you can compile 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 without problems. >

Note

To return to the standard toolchain run the command in the terminal:

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

Reply adapted from this one in SO English .

    
22.08.2017 / 16:19
0

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

pod repo update
pod install

They guarantee that your cocoapods have updated repositories and that your project has the latest version of objectmapper and other pods (unless you have specified otherwise in PodFile, of course).

    
06.09.2017 / 21:27