1

I am working on a Flutter application which makes use of the following package: https://pub.dev/packages/flutter_mapbox_navigation

While running this for iOS 15.2 Simulator I am getting the following error:

Swift Compiler Error (Xcode): Could not find module 'MapboxDirections' for target 'arm64-apple-ios-simulator'; found: i386, x86_64-apple-ios-simulator, x86_64, i386-apple-ios-simulator, at: /Users/absatyaprakash/Projects/one-stop-2021/app/one_stop/build/ios/Debug-iphonesimulator/MapboxDirections/MapboxDirections.framework/Modules/MapboxDirections.swiftmodule
/Users/absatyaprakash/Projects/one-stop-2021/app/one_stop/ios/Pods/MapboxNavigation/Sources/MapboxNavigation/Array.swift:0:7

I am using an Apple Silicon MacBook. Initially, I was facing the issue described here - Xcode 12, building for iOS Simulator, but linking in an object file built for iOS, for architecture 'arm64', but after excluding the arm64 architecture from the Build Settings, and adding the following to my Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end
end

I am not getting this anymore. Now I am stuck at the above mentioned issue. I have tried numerous solutions (including the one here - could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64) since the last 2 days, but nothing seems to help.

imperial-lord
  • 601
  • 8
  • 20
  • Similar issue here - https://github.com/eopeter/flutter_mapbox_navigation/issues/148 – imperial-lord Feb 07 '22 at 09:01
  • 1
    known issue, no fixed solution yet, I ended up upgrading all libraries and changing a few build settings. unfortunately on client machine if failed. i had to made a few more changes. – Blind Ninja Feb 07 '22 at 09:05
  • Did it work finally after the changes? – imperial-lord Feb 07 '22 at 09:17
  • 1
    yes but different changes for different machines. – Blind Ninja Feb 07 '22 at 09:19
  • Would you mind elaborating a bit about those changes? It might be useful for me. – imperial-lord Feb 07 '22 at 09:21
  • 2
    I am not sure, I work on native. You can try two things - `Build Configuration` is set to `Release` for your project active `scheme` and `Build Active Architectures Only` is `Yes` in `Build Settings` for your target. You are flutter, this might mess with other flutter dependencies. – Blind Ninja Feb 07 '22 at 09:26
  • 1
    you can search both changes here on stackoverflow, there are lots of answers available with steps. – Blind Ninja Feb 07 '22 at 09:29
  • I had actually modified these before asking the question, since some answers were suggesting this. No results still though. – imperial-lord Feb 07 '22 at 11:04
  • For M1 Chip Based Mac follow this [Link](https://stackoverflow.com/a/72257205/5575548) – emraz May 16 '22 at 09:47

0 Answers0