Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #1031

Closed
ansarikhurshid786 opened this issue Sep 17, 2020 · 29 comments
Labels
upstream the bug source is a bug in native mapbox gl

Comments

@ansarikhurshid786
Copy link
Contributor

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

@allthetime
Copy link

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.

@ghitier
Copy link

ghitier commented Sep 24, 2020

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

@allthetime
Copy link

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.

@ansarikhurshid786
Copy link
Contributor Author

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

@damathryx
Copy link

I'm also having this problem with xcode 12

@rvdende
Copy link

rvdende commented Oct 26, 2020

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

@Gnative
Copy link
Contributor

Gnative commented Nov 15, 2020

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

@rvdende
Copy link

rvdende commented Nov 15, 2020

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

@timkuilman
Copy link
Contributor

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

Debug build on a fresh Xcode install.

@ataravati
Copy link

Why is this issue closed?

@natew
Copy link

natew commented Dec 18, 2020

@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.

@ataravati
Copy link

@natew This:

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

@natew
Copy link

natew commented Dec 18, 2020

@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?

@bosung90
Copy link

Getting a same problem on a Apple Chip Mac Mini

@babeone
Copy link

babeone commented Dec 31, 2020

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

@babeone
Copy link

babeone commented Jan 4, 2021

Hi all, check this https://github.com/react-native-mapbox-gl/maps/issues/1139 for a workaround

@rvdende
Copy link

rvdende commented Jan 26, 2021

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

@babeone
Copy link

babeone commented Jan 26, 2021

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

@ansarikhurshid786
Copy link
Contributor Author

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

@noway
Copy link

noway commented Apr 1, 2021

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

@natew
Copy link

natew commented Apr 6, 2021

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

@noway
Copy link

noway commented Apr 7, 2021

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

@natew
Copy link

natew commented Apr 9, 2021

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

@noway
Copy link

noway commented Apr 10, 2021

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)

@stale
Copy link

stale bot commented Jun 11, 2021

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.

@stale stale bot added the wontfix This will not be worked on label Jun 11, 2021
@noway
Copy link

noway commented Jun 11, 2021

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.

@stale stale bot removed the wontfix This will not be worked on label Jun 11, 2021
@ferdicus
Copy link
Member

ferdicus commented Jun 11, 2021

@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 our installation guides

@ferdicus
Copy link
Member

I would urge everyone subscribed to this ticket to actually test out what I mentioned in my earlier comment and report back.

I can not test this out as I don't have an M1 machine.
If anyone can point me to a reproduction that's possible without an M1, I'd be glad to give it a go.

@ferdicus ferdicus added the upstream the bug source is a bug in native mapbox gl label Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream the bug source is a bug in native mapbox gl
Projects
None yet
Development

No branches or pull requests