我的安卓设备上React Native是空白的。它只有一个带有Google标志的灰色屏幕。与React-native-maps Blank page Only google logo不同的是,它在模拟器上工作正常,但在真实设备上却不行。
我在网上搜索了这个问题:
- The API should be fine
- stylesheet is ok
- it's working on genymotion emulator
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>`
..和样式:
`const styles = StyleSheet.create({
mapContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#ecf0f1',
},
map: {
flex: 1,
borderRadius: 4,
width,
height,
zIndex: 1,
},`