Maps: linking in dylib built for iOS, file 'projectroot/node_modules/@react-native-mapbox-gl/maps/ios/Mapbox.framework/Mapbox' for architecture arm64 in XCode 12

Created on 17 Sep 2020  路  28Comments  路  Source: react-native-mapbox-gl/maps

Describe the bug
I have update xcode 11.x to xcode 12. Now I am getting error following error while running application in simulator:
"ld: building for iOS Simulator, but linking in dylib built for iOS, file 'rootproject/node_modules/@react-native-mapbox-gl/maps/ios/Mapbox.framework/Mapbox' for architecture arm64"

To Reproduce
1) Open project with xcode 12
2) Build project

Example:

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • Platform: iOS
  • Device: iPhone SE
  • Emulator/ Simulator: yes
  • OS: iOS 14
  • react-native-mapbox-gl Version: 7.0.8
  • React Native Version : 0.59.10
% react-native info
info 
  React Native Environment Info:
    System:
      OS: macOS 10.15.6
      CPU: (16) x64 Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz
      Memory: 1.93 GB / 16.00 GB
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 10.15.0 - /usr/local/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.14.8 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
      Android SDK:
        API Levels: 28, 29, 30
        Build Tools: 23.0.1, 23.0.3, 25.0.1, 25.0.2, 26.0.1, 27.0.1, 27.0.3, 28.0.2, 28.0.3, 29.0.0, 30.0.1, 30.0.2
        System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6626763
      Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.10 => 0.59.10 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Most helpful comment

@ataravati are you on an M1 mac or on an older mac? I'm having this problem on an M1 mac, I don't think I can exclude arm64.

It does build to my physical device though.

Could we get issue re-opened @mfazekas?

All 28 comments

I also have this issue after upgrading to Catalina + XCode 12 and am disheartened to not find much information on the problem.

One "solution" might be to revert to XCode 11 (not sure this is possible in Catalina)

I attempted reverting to the legacy build system for xcode and got the same issue.

Cleaning the build folder did the trick for me (Product > Clean Build Folder).

Also to note... Only get this error when building for simulator and "release" build configuration. So it's not a show stopper but just annoying to not be able to test release on simulator. Will try cleaning build tomorrow.

Yes after clear build work through xcode. it is still not working by following command:
react-native run-ios

I'm also having this problem with xcode 12

Can confirm, make sure you are doing a debug build for the simulator and then it works.

Worth reading this thread if you are hitting this problem with building release versions on the Simulator from xcode 12.

https://developer.apple.com/forums/thread/657913

I had to update to XCode 12.2 beta 4 after the iphone update...

Same issue with XCode version 12.2 (12B45b) on MacBook Pro (13-inch, M1, 2020)

Debug build on a fresh Xcode install.

Why is this issue closed?

@ataravati what worked? Are you on m1/arm?

It was working for me a few days ago after some attempts, but for some reason regressed. I get this error again, tried a few different versions of everything, cleaning, legacy build, lots of config variants. No dice.

Luckily I have an old build on my phone that I can use for now, but any tips appreciated.

@natew This:

navigate to Build Settings of your project and add Any iOS Simulator SDK with value arm64 inside Excluded Architecture.

@ataravati are you on an M1 mac or on an older mac? I'm having this problem on an M1 mac, I don't think I can exclude arm64.

It does build to my physical device though.

Could we get issue re-opened @mfazekas?

Getting a same problem on a Apple Chip Mac Mini

Yeah me too, i'm getting this error on M1 mac and Xcode 12, someone resolved?

I get this error when building for the simulator as release instead of debug.

Solution is to go to Product > Scheme > Edit Scheme

Set Build Configuration to Debug
Tick Debug Executable

@rvdende is this the problem? https://github.com/react-native-mapbox-gl/maps/issues/1097
Downgrade pods to 1.9.3

@babeone yeh #1097 issue. i am facing same issue for archive

This issue has nothing to do with archiving. This issue is scoped to the linking issue

I have everything working except for some reason errors on doing react-native Release mode, but that seems to fix with:

arch -x86_64 react-native run-ios

@natew that runs the build in Rosetta2 and would not be as performant as Apple Silicon.

@noway of course. It's a temporary solution I found for anyone else searching,

Fair enough.

For anyone else: another temporary solution is to build onto a real device, and not to Simulator. (the error only appears to be when you build for simulator)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue is not stale. It's still happening @stale please remove the label.

As a workaround, we have to completely remove Mapbox in Simulator builds which is a huge pain.

@noway, with #1311 we started to support MapLibre as a native SDK solution.
It is actively supported compared to Mapbox's "old" SDKs that are packed into this repo per default.
This ticket in their repo mentions this issue specifically.
Instruction on how to replace the underlying native SDK is described in out installation guides

Was this page helpful?
0 / 5 - 0 ratings