tristanhimmelman/ObjectMapper

XCODE 12.0 Could not find module 'ObjectMapper' for target 'arm64-apple-ios-simulator';

Opened this issue · 4 comments

Im using a M1 Mac, and I keep getting this error, are you planning in adding support soon for M1?
Could not find module 'ObjectMapper' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_6

Hi @mxnmike , I am facing the same issue, any solution that worked for you ?

I'm encountered same issue here. Using Apple silicon (M1) too.

Note that is compile error only happen choosing iOS simulator.
Choosing real device or Mac simulated iPad will no issues.

Here is more info about the differance between Intel Macs and Apple silicon (M1) Macs

Apple silicon (M1) Macs

  • Model: MacBook Pro (13-inch, M1, 2020)

  • Chip: Apple M1

  • macOS: Big Sur 11.5

  • Xcode version: 12.5.1 (12E507)

  • Cocoapod version: 1.11.2

  • Ruby version: 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

  • Target iOS simulator model: iPhone 11 Pro

  • Target iOS simulator version: iOS 14.5 (18E182)

Pod install using x86_64 mode

$ arch -x86_64 pod install

also, ffi is installed beforehand.

$ sudo arch -x86_64 gem install ffi

Intel Macs

  • Model: MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports)

  • Processor: 2.7 GHz Quad-Core Intel Core i7

  • macOS: Big Sur 11.6

  • Xcode version: 12.5.1 (12E507)

  • Cocoapod version: 1.11.2

  • Ruby version: 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

  • Target iOS simulator model: iPhone 11 Pro

  • Target iOS simulator version: iOS 14.5 (18E182)

OK, I found the solutions.
In short, not the ObjectMapper code problems.

You NEED TO set your Pods project's Build settings.

Build Active Architecture only set to NO

Like this.

Screen Shot 2021-12-12 at 5 31 53 PM


OR using ruby scripts for set every dependency modules Build Active Architecture only to NO.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |configuration|
      target.build_settings(configuration.name)['ONLY_ACTIVE_ARCH'] = 'NO'
    end
  end
end

Reference:
https://gist.github.com/funroll/7faf18b4972d72cd284e


It will solve the problems. 🙂

Hi, I am also encounter the same issue using Xcode16, M1machine with minimum target iOS 12 running on without rosetta simulator with old version of Object mapper 3.5.3.
could not find module for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator

If I run on Rosetta Simulator it's working fine but it's failed on CI/CD pipeline.

When update the version 4.4.2 (was 3.5.3) then its giving the different error:
module map file '/Users/abc/Library/Developer/Xcode/DerivedData/Xyz-rqxtbepowhrkra/Build/Products/Debug-iphonesimulator/ObjectMapper/ObjectMapper.modulemap' not found

Can you please guide me how this will work?