Maps: Undefined symbols for architecture x86_64 error when upgrading to v7.0.0-rc3

Created on 1 Jul 2019  Â·  14Comments  Â·  Source: react-native-mapbox-gl/maps

Describe the bug
I've been using @react-native-mapbox-gl/maps v7.0.0-rc2 just fine, but when I upgrade to v7.0.0-rc3 I get the following build error on iOS:

Undefined symbols for architecture x86_64:
  "_MGLAltitudeForZoomLevel", referenced from:
      -[RCTMGLMapView altitudeFromZoom:atLatitude:atPitch:] in libRCTMGL.a(RCTMGLMapView.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm using the Manual Installation instructions, rather than Using CocoaPods. I tried removing and re-adding the manual installation, but get the same results. Do you have an idea how to fix this? I'll keep looking into solutions and post my fix here if I find it in the meantime.

Versions (please complete the following information):

  • Platform: iOS
  • Device: iPhoneXR simulator
  • OS: iOS12.2
  • SDK Version 7.0.0-rc3
  • React Native Version: 0.59

All 14 comments

I tried running it in both the new and legacy Xcode build systems, with mostly the same result. When building with the new Xcode build system, it instead says Undefined symbols for architecture arm64 rather than x86_64.

I've tried reinstalling my node_modules and cleaning my Xcode project with no luck. I tried git cloning my repo to a different location and building it, same issue. I've also tried a physical device.

I've gone through undoing and redoing the manual installation a couple times now, with no luck.

Anyway, I'm hoping this is an issue someone else has come across when upgrading, or has an idea why it's happening. My last resort is to start a brand new RN project and migrate all of my code to it, but that would be quite an effort.

It starts failing for me on this commit 6cecef1259a507b6e6622063fdacc85af7d4399c.

I ran into an xcode error after upgrading to -rc3.

On Monday, Jul 01, 2019 at 8:33 PM, tsemerad

I tried running it in both the new and legacy Xcode build systems, with mostly the same result. When building with the new Xcode build system, it instead says Undefined symbols for architecture arm64 rather than x86_64.

I've tried reinstalling my node_modules and cleaning my Xcode project with no luck. I tried git cloning my repo to a different location and building it, same issue. I've also tried a physical device.

I've gone through undoing and redoing the manual installation a couple times now, with no luck.

Anyway, I'm hoping this is an issue someone else has come across when upgrading, or has an idea why it's happening. My last resort is to start a brand new RN project and migrate all of my code to it, but that would be quite an effort.

It starts failing for me on this commit 6cecef1 (https://github.com/react-native-mapbox-gl/maps/commit/6cecef1259a507b6e6622063fdacc85af7d4399c).

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub (https://github.com/react-native-mapbox-gl/maps/issues/194?email_source=notifications&email_token=AAG2QB2MGSJQWPSVEXRGBKDP5K46FA5CNFSM4H4NWMUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY733PA#issuecomment-507493820), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAG2QB7PMLA7NCXYNKDE7NLP5K46FANCNFSM4H4NWMUA).

It seems like the framework may be cached by npm/yarn. Can you try the folllwing:

1) Remove node_modules and do a clean install of all dependencies

If this doesn’t work:

2) Clean your npm/yarn cache and repeat 1)

Thanks for the suggestion. I just cleaned my yarn cache and reinstalled my node_modules, but that didn't make a difference.

I also tried moving from node 8 to node 10, but that didn't make a difference either (I didn't think it would, but I'm running out of ideas).

@tsemerad the MGLAltitudeForZoomLevel should be defined in Mapbox.framework. Verify in you xcode project that the linked Mapbox.framework version is correct. (5.0.0)

That was it! Thanks so much @mfazekas. My Xcode project was pointing to a different Mapbox.framework saved in my project, which was 4.x. When I had undone the manual installation instructions, it still left the Mapbox.framework in the project, so redoing the Embedded Binaries step somehow ended up using that incorrect Mapbox.framework.

This is definitely a mistake specific to my project, since my project used to require a custom build of Mapbox.framework, but no longer needs it. Thanks again for your help, and I apologize for consuming people's attention on what ended up being my project-specific issue.

@mfazekas @tsemerad I am having a similar issue and cannot find MGLAltitudeForZoomLevel in my Mapbox.framework. How do I check the version and update if I need to? This is the error I receive when trying to move from react-native-mapbox-gl to react-native-mapbox-gl/maps. Thanks!

Undefined symbols for architecture x86_64:
"_MGLAltitudeForZoomLevel", referenced from:
-[RCTMGLMapView altitudeFromZoom:atLatitude:atPitch:] in libRCTMGL.a(RCTMGLMapView.o)
"_OBJC_CLASS_$_MGLRasterTileSource", referenced from:
objc-class-ref in libRCTMGL.a(RCTMGLRasterSource.o)
"_OBJC_CLASS_$_MGLVectorTileSource", referenced from:
objc-class-ref in libRCTMGL.a(RCTMGLVectorSource.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@jolortiz If you're upgrading from react-native-mapbox-gl to react-native-mapbox-gl/maps, you almost certainly weren't yet using Mapbox.framework v5.x since the old repo never upgraded to it.

To fix your issue, I'd undo the installation instructions you did on the old repo, including removing Mapbox.framework from the Xcode project, and redo them based on the instructions from the new repo.

@mfazekas @tsemerad I am having a similar issue and cannot find MGLAltitudeForZoomLevel in my Mapbox.framework. How do I check the version and update if I need to? This is the error I receive when trying to move from react-native-mapbox-gl to react-native-mapbox-gl/maps. Thanks!

Undefined symbols for architecture x86_64:
"_MGLAltitudeForZoomLevel", referenced from:
-[RCTMGLMapView altitudeFromZoom:atLatitude:atPitch:] in libRCTMGL.a(RCTMGLMapView.o)
"_OBJC_CLASS_$_MGLRasterTileSource", referenced from:
objc-class-ref in libRCTMGL.a(RCTMGLRasterSource.o)
"_OBJC_CLASS_$_MGLVectorTileSource", referenced from:
objc-class-ref in libRCTMGL.a(RCTMGLVectorSource.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm sure that I'm using Mapbox.framework v5.x but I still have these errors!

Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_MMEEventsManager", referenced from:
objc-class-ref in CarPlayManager.o
objc-class-ref in RouteMapViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This should be reopened. I have the same issue while upgrading from the previous React Native repo and I'm using Mapbox framework version 5.x

This should be reopened. I have the same issue while upgrading from the previous React Native repo and I'm using Mapbox framework version 5.x

That doesn’t mean there is a bug/issue in this repo, it means you haven’t fully been able to remove old references or cleaned your build properly.

Please fully uninstall the old version of mapbox, remove all references in both JS and native platform side and follow the install guide. If you upgraded to RN60, make sure you use autolinking.

@kristfal actually that is accurate. I did removed manually the old references and managed to get it up and running. For anyone else who will getting a hard time here and while trying to link manually what i did is that I deleted the files of the previous framework and put in the new ones by hand. This folder over here:

Screenshot 2019-11-27 at 19 38 44

@tsemerad cheers for the hint

Perfect! Glad to hear. Prior to autolinking and pods, this was a bit tricky. Subsequent updates should be much more straightforward:)

Was this page helpful?
0 / 5 - 0 ratings