React-native-mapbox-gl: show map not work in android

Created on 30 Jan 2019  路  5Comments  路  Source: nitaliano/react-native-mapbox-gl

i'm use this code , but my map not displaying!!

import Mapbox from '@mapbox/react-native-mapbox-gl';
Mapbox.setAccessToken('<my token >');
export class googleMap extends Component<{}>{ 
    render() {
        return (
        <View style={{flex:1}}>
        <Mapbox.MapView
        logoEnabled={false}
        styleURL={Mapbox.StyleURL.Street}
        zoomLevel={15}
        centerCoordinate={[11.256, 43.770]}
        style={styles.container}>
        </Mapbox.MapView>
        </View>
        );
        }
    } ;
const styles = StyleSheet.create({

    container: {
        flex: 1,
      },

})
export default googleMap;

screenshot_1548852827

Most helpful comment

Mine crashes when I call: Mapbox.setAccessToken() ... Application just stops and closes in the Android simulator.

All 5 comments

Mine crashes when I call: Mapbox.setAccessToken() ... Application just stops and closes in the Android simulator.

@javadmohammadis Mine ended up being a problem with the Android Studio emulators. I switched to another emulator (genymotion) and now the maps appear.

thanks. I run the app on an Android device, is ok

@nitaliano issue can be closed, it's an known problem with android emulators.

This is fixed in master.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smoll picture smoll  路  4Comments

Amalp picture Amalp  路  3Comments

digitaldavenyc picture digitaldavenyc  路  4Comments

madroneropaulo picture madroneropaulo  路  4Comments

igor9silva picture igor9silva  路  3Comments