Please provide the following:
- SDK Version:48.0.0
- Platforms(Android/iOS/web/all):Android
- react-native-maps
after build the app with this command ```
eas build -p android --profile preview
when i open app and click on MapRoute Screen the app get crahsed,
this is my code import React, {useState, useEffect} from 'react';
import { View, Text, StyleSheet } from 'react-native';
import MapView from 'react-native-maps';
// import * as Location from "expo-location";
import * as Permissions from 'expo-permissions';
const MapRoute = () => {
const [isEnabled, setIsEnabled] = useState(false);
useEffect(() => {
const getLocationPermission = async () => {
const { status } = await Permissions.askAsync(Permissions.LOCATION_FOREGROUND);
if (status !== 'granted') {
console.log('Permission to access location was denied');
setIsEnabled(false);
} else {
console.log('Permission to access location granted');
setIsEnabled(true);
}
};
getLocationPermission();
}, []);
return (
<View style={styles.container}>
{
isEnabled ?
<MapView
showsCompass={true}
style={styles.map}
initialRegion={{
latitude: 18.503977,
longitude: 73.900471,
latitudeDelta: 0.005,
longitudeDelta: 0.0005,
}}
// provider={PROVIDER_GOOGLE}
showsMyLocationButton={true}
showsUserLocation={true}
>
</MapView>
: <View>
<Text>You don't have permission!!!</Text>
</View>
}
</View>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
map: {
width: '100%',
height: '100%',
},
});
export default MapRoute
app.json file code
"android": {
"permissions": [
"CAMERA",
"android.permission.CAMERA",
"ACCESS_FINE_LOCATION",
"ACCESS_COARSE_LOCATION"
],
I hope you're able to find a resolution with the help of above code