React native is blank on my android device. It's just a grey screen with the google logo. Unlike React-native-maps Blank page Only google logo it is is working on a simulator but not on real device.
I searched for the problem online:
working on android virtual device
Perfectly working on Expo but not when I download the app from playstore. The meta-data in AndroidManifest.xml looks like this:
This is how the mapView looks like:
` <MapView
showsUserLocation={false}
style={styles.map}
provider='google'
ref={ref => { map3 = ref; }}
onMapReady = { this.onMapReady }
initialRegion={this.state.region}
>
<Marker
image={logo}
coordinate={this.state.coordinate}
/>
</MapView>`
.. and the style:
`const styles = StyleSheet.create({
mapContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#ecf0f1',
},
map: {
flex: 1,
borderRadius: 4,
width,
height,
zIndex: 1,
},`
If all else fails, like was in my case, don't forget the basic stuff. Turns out I hadn't enabled 'Maps SDK for Android' in the console.developers.google.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With