nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 696 forks source link

[Android] Mapbox GL crashes on orientation change #1102

Open fnusneha opened 6 years ago

fnusneha commented 6 years ago

I'm using mapbox/react-native-mapbox-gl 6.0.3 in a react native page. On multiple orientation changes, the app crashes with a SIGSEGV. This happens intermittently, and not on every orientation change.

This is the way I'm using the map in my component's render():

<Mapbox.MapView
                      styleURL={Mapbox.StyleURL.Street}
                      zoomLevel={this.props.zoomLevel}
                      centerCoordinate={[Number(location.longitude), Number(location.latitude)]}
                      style={styles.map}
                      ref={(ref) => this.map = ref}
                      zoomEnabled={this.props.zoomEnabled}
                      pitchEnabled={false}
                      scrollEnabled={this.props.scrollEnabled}
                      rotateEnabled={false}
                      logoEnabled={false}
                      onPress={() => { this.onPress() }}
                      minZoomLevel={2}
                      maxZoomLevel={15}>
                        <Mapbox.RasterSource key='d' id='aqiSource' url={url} tileSize={512}>
                          <Mapbox.RasterLayer id='aqiLayer' sourceID='aqiSource' style={{rasterOpacity:0.7}} />
                        </Mapbox.RasterSource>
                        <Mapbox.ShapeSource id='currentLocationMarkerSource' shape={this.state.featureCollection}>
                          <Mapbox.SymbolLayer
                            id='currentLocationMarkerSymbols'
                            style={[mapStyles.icon, {textField:markerText}]}
                            aboveLayerID='aqiLayer' />
                        </Mapbox.ShapeSource>
                  </Mapbox.MapView>

This is a sample seg fault I'm getting:

03-08 01:07:41.867 7061-7061/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x69747269
03-08 01:07:41.884 7061-7061/? A/DEBUG: Abort message: 'PRODUCTION: Adjust is running in Production mode. Use this setting only for the build that you want to publish. Set the environment to `sandbox` if you want to test your app!'
03-08 01:07:41.884 7061-7061/? A/DEBUG:     r0 69747265  r1 8b840700  r2 fff0dae8  r3 af8ac215
03-08 01:07:41.884 7061-7061/? A/DEBUG:     r4 fff0dafc  r5 8b840700  r6 fff0dae8  r7 fff0da78
03-08 01:07:41.885 7061-7061/? A/DEBUG:     r8 fff0dae8  r9 fff0dafc  sl 3370a6b8  fp 3373fc90
03-08 01:07:41.885 7061-7061/? A/DEBUG:     ip 9334c128  sp fff0d9d8  lr af8ac235  pc af9e8e66  cpsr a00e0030
03-08 01:07:41.890 7061-7061/? A/DEBUG: backtrace:
03-08 01:07:41.890 7061-7061/? A/DEBUG:     #00 pc 001d8e66  /data/app/com.aws.android-2/lib/arm/libmapbox-gl.so
03-08 01:07:41.890 7061-7061/? A/DEBUG:     #01 pc 0009c231  /data/app/com.aws.android-2/lib/arm/libmapbox-gl.so
03-08 01:07:41.890 7061-7061/? A/DEBUG:     #02 pc 00099249  /data/app/com.aws.android-2/lib/arm/libmapbox-gl.so
03-08 01:07:41.891 7061-7061/? A/DEBUG:     #03 pc 00099047  /data/app/com.aws.android-2/lib/arm/libmapbox-gl.so
03-08 01:07:41.891 7061-7061/? A/DEBUG:     #04 pc 000cf50d  /data/app/com.aws.android-2/lib/arm/libmapbox-gl.so
03-08 01:07:41.891 7061-7061/? A/DEBUG:     #05 pc 000cf553  /data/app/com.aws.android-2/lib/arm/libmapbox-gl.so
03-08 01:07:41.891 7061-7061/? A/DEBUG:     #06 pc 01ca5c71  /data/app/com.aws.android-2/oat/arm/base.odex (offset 0x1a84000)
nitaliano commented 6 years ago

is this only happening with a RasterLayer?

L-Yeiser commented 5 years ago

We are seeing this and our phone is locked to portrait. Any ideas?

kristfal commented 5 years ago

Can you try defining the map view style as:

position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0,

and see if you can reproduce?