Images/ShapeSource/SymbolLayer makes the app crash
See original GitHub issueDescribe the bug When I try to use Images or ShapeSource or SymbolLayer, the app crashes during the launch.
To Reproduce You can check this test repo, which is a copy-paste of ShapeSourceIcon example
App.js
import React from 'react';
import { View } from 'react-native';
import MapboxGL from '@react-native-mapbox-gl/maps';
import variables from './env'
import exampleIcon from './assets/example.png';
MapboxGL.setAccessToken(variables.MAPBOX_API_TOKEN);
const styles = {
icon: {
iconImage: ['get', 'icon'],
iconSize: [
'match',
['get', 'icon'],
'example',
1.2,
'airport-15',
1.2,
/* default */ 1,
],
},
};
const featureCollection = {
type: 'FeatureCollection',
features: [
{
type: 'Feature',
id: '9d10456e-bdda-4aa9-9269-04c1667d4552',
properties: {
icon: 'example',
},
geometry: {
type: 'Point',
coordinates: [-117.20611157485, 52.180961084261],
},
},
{
type: 'Feature',
id: '9d10456e-bdda-4aa9-9269-04c1667d4552',
properties: {
icon: 'airport-15',
},
geometry: {
type: 'Point',
coordinates: [-117.205908, 52.180843],
},
},
{
type: 'Feature',
id: '9d10456e-bdda-4aa9-9269-04c1667d4552',
properties: {
icon: 'pin',
},
geometry: {
type: 'Point',
coordinates: [-117.206562, 52.180797],
},
},
],
};
class ShapeSourceIcon extends React.Component {
render() {
return (
<View style={{ flex: 1 }}>
<MapboxGL.MapView style={{ flex: 1 }}>
<MapboxGL.Camera
zoomLevel={17}
centerCoordinate={[-117.20611157485, 52.180961084261]}
/>
<MapboxGL.Images
images={{example: exampleIcon, assets: ['pin']}}
/>
<MapboxGL.ShapeSource
id="exampleShapeSource"
shape={featureCollection}
>
<MapboxGL.SymbolLayer id="exampleIconName" style={styles.icon} />
</MapboxGL.ShapeSource>
</MapboxGL.MapView>
</View>
);
}
}
export default ShapeSourceIcon;
Expected behavior No crash
Versions (please complete the following information):
expo diagnostics:
Expo CLI 2.21.2 environment info:
System:
OS: macOS 10.14.5
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.1 - /usr/local/bin/node
Yarn: 1.13.0 - ~/.yarn/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.8 => 0.59.8
npmGlobalPackages:
expo-cli: 2.21.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Images/ShapeSource/SymbolLayer makes the app crash #228
Describe the bug. When I try to use Images or ShapeSource or SymbolLayer, the app crashes during the launch. To Reproduce
Read more >rnmapbox/Lobby - Gitter
I'm fighting with a crash react-native application on unblocking iPhone which is ... is it possible to "compose" multiple SymbolLayer within a ShapeSource?...
Read more >App crash when react-native-mapbox-gl in release mode
App is working fine in debug mode and it is crashing in release mode When we go the map page and apply zoom...
Read more >@react-native-mapbox-gl/maps | Yarn - Package Manager
Fix heading indicator alignment #1215; App crash when ProGuard is set to true #1184; [iOS] Implemented ShapeSource.features(...) method #1140; style json ...
Read more >mapbox - Bountysource
If the icon is in the app's sources and included via a require() in the shapesource (via images={{example: exampleIcon}} ) it also doesn't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
any solution for this Class MGLFaux3DUserLocationAnnotationView is implemented in both in latest version
Same issue I’m facing,
objc[66543]: Class MGLFaux3DUserLocationAnnotationView is implemented in both /Users/divya/Library/Developer/CoreSimulator/Devices/D067CB6D-683A-4F7B-ADBD-9BD9AA99E3B1/data/Containers/Bundle/Application/5288A4C7-F880-412C-A0E1-87101E54FC87/PointzOfficialApp.app/Frameworks/Mapbox.framework/Mapbox (0x114ba47d8) and /Users/divya/Library/Developer/CoreSimulator/Devices/D067CB6D-683A-4F7B-ADBD-9BD9AA99E3B1/data/Containers/Bundle/Application/5288A4C7-F880-412C-A0E1-87101E54FC87/PointzOfficialApp.app/PointzOfficialApp (0x105ff7498). One of the two will be used. Which one is undefined. objc[66543]: Class MGLUserLocationHeadingArrowLayer is implemented in both /Users/divya/Library/Developer/CoreSimulator/Devices/D067CB6D-683A-4F7B-ADBD-9BD9AA99E3B1/data/Containers/Bundle/Application/5288A4C7-F880-412C-A0E1-87101E54FC87/PointzOfficialApp.app/Frameworks/Mapbox.framework/Mapbox (0x114ba4e68) and /Users/divya/Library/Developer/CoreSimulator/Devices/D067CB6D-683A-4F7B-ADBD-9BD9AA99E3B1/data/Containers/Bundle/Application/5288A4C7-F880-412C-A0E1-87101E54FC87/PointzOfficialApp.app/PointzOfficialApp (0x105ff75d8). One of the two will be used. Which one is undefined. objc[66543]: Class MGLUserLocationHeadingBeamLayer is implemented in both /Users/divya/Library/Developer/CoreSimulator/Devices/D067CB6D-683A-4F7B-ADBD-9BD9AA99E3B1/data/Containers/Bundle/Application/5288A4C7-F880-412C-A0E1-87101E54FC87/PointzOfficialApp.app/Frameworks/Mapbox.framework/Mapbox (0x114ba5d68) and /Users/divya/Library/Developer/CoreSimulator/Devices/D067CB6D-683A-4F7B-ADBD-9BD9AA99E3B1/data/Containers/Bundle/Application/5288A4C7-F880-412C-A0E1-87101E54FC87/PointzOfficialApp.app/PointzOfficialApp (0x105ff7628). One of the two will be used. Which one is undefined. flipper: FlipperClient::addPlugin Inspector flipper: FlipperClient::addPlugin Preferences flipper: FlipperClient::addPlugin React flipper: FlipperClient::addPlugin Network (lldb)
Please help, looks like it’s annoying