React-native-mapbox-gl: Undefined symbols for architecture x86_64

Created on 14 Nov 2017  路  9Comments  路  Source: nitaliano/react-native-mapbox-gl

"@mapbox/react-native-mapbox-gl": "^6.0.0"
"react": "16.0.0-beta.5",
"react-native": "0.49.3"

I've just been upgrading to the latest version but I'm hitting this error in Xcode...

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_MGLFillExtrusionStyleLayer", referenced from:
      objc-class-ref in libRCTMGL.a(RCTMGLFillExtrusionLayer.o)
  "_OBJC_CLASS_$_MGLLight", referenced from:
      objc-class-ref in libRCTMGL.a(RCTMGLLight.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Anyone seen this before? I've re-done the install steps but I can't get rid of it and can't build my project anymore.

Most helpful comment

@benvium I don't have 'libRCTMapboxGL.a' included anymore so it's not that. I'd already moved over to the @mapbox version, these errors have occurred running a fresh yarn install on 6.0.0

All 9 comments

I get a similar error, and the same problem:

Xcode 8.3.3

"react": "16.0.0-beta.5",
"react-native": "0.49.3",
"@mapbox/react-native-mapbox-gl": "^6.0.0",
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_MGLMultiPointFeature", referenced from:
      objc-class-ref in libRCTMapboxGL.a(RCTMapboxGLManager.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I find a solution, I'll post it

@olliekav Hi Ollie.

I found a solution that worked for me - the issue is that the library that's linked has changed name in the new version, and that I had both the old library (libRCTMapboxGL.a) and the new library (libRCTMGL.a ) in Xcode's 'link binary with libraries' section.

When I deleted libRCTMapboxGL.a from Link Binary with Libraries, the app would build.

@benvium I don't have 'libRCTMapboxGL.a' included anymore so it's not that. I'd already moved over to the @mapbox version, these errors have occurred running a fresh yarn install on 6.0.0

So I nuked the whole thing again this morning, and managed to get it to build. Now running into more issues though...

TypeError: undefined is not an object (evaluating
'reactNativeMapboxGl2.default.userTrackingModes.Follow')

@olliekav I had that one for a while this morning too - I believe it was helped after quitting Xcode and deleting the ios/build directory

@benvium Well that disappeared after a few restarts, I keep getting...

TypeError:
_this4.map.SetCenterCoordinate is not a function

every 5 or so refreshes as well, very odd.

Also a blank map even though I my access key hasn't changed at all...

<View style={mapStyles.mapContainer}> <MapboxGL.MapView ref={ref => this.mapView = ref} styleURL={MapboxGL.StyleURL.Street} style={mapStyles.map} centerCoordinate={[this.state.center.latitude, this.state.center.longitude]} zoomLevel={this.state.zoom} rotateEnabled={true} scrollEnabled={true} showUserLocation={true} userTrackingMode={this.state.userTrackingMode} onRegionDidChange={this.onRegionDidChange} onPress={this.addNewMarker} > {this.renderAnnotations()} </MapboxGL.MapView> </View>

Are you sure you don't have any code calling SetCenterCoordinate there's nothing in the JS that makes reference to that?

@nitaliano Yes, sorry I'm trying to write all our v5 code into v6 and keep running into changes I need to make! I've switched this out for moveTo now.

Is there anywhere to see the breaking changes and what they compare to in the new version, Specifically how things like annotationImage are handled in v6? I'm getting a bit lost how to handle setting a custom marker when adding multiple points. The examples are helping but don't capture some things. This v6 rewrite looks great btw :)

For annotation images just add an Image tag as a child to the Annotation here is an example https://github.com/mapbox/react-native-mapbox-gl/issues/748#issuecomment-343869915, and if you could I would recommend moving away from AnnotationViews if you're not using Callouts and use a ShapeSource with a SymbolLayer.

There are no breaking changes log as the whole thing is one giant breaking change haha if you need help with migrating over feel free to keep opening issues or message me directly

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexisohayon picture alexisohayon  路  4Comments

Craytor picture Craytor  路  3Comments

kristfal picture kristfal  路  3Comments

EwanValentine picture EwanValentine  路  3Comments

smoll picture smoll  路  4Comments