i have the same problem but with location, im using expo-location to get the user current location and save it on firebase DB , the app works well with expo go but when i build the apk version and download it to my android device the app crushes when i click the button that trigger the getLocation function, the first run the app asks me for permission, i granted and then it crushes //Get Driver home Location const getLocation = async () => { Keyboard.dismiss() setLocationLoading(true) try { const isAvailable = await Location.hasServicesEnabledAsync(); if (!isAvailable) { createAlert('الرجاء تفعيل خدمات الموقع الجغرافي للتطبيق') setLocationLoading(false); return; }
let { status } = await Location.requestForegroundPermissionsAsync();
if (status !== 'granted') {
createAlert('حدث خطأ اثناء تحديد الموقع. يرجى المحاولة مرة أخرى');
setLocationLoading(false);
return;
}
console.log('Getting current position...');
let location = await Location.getCurrentPositionAsync({
accuracy: Location.Accuracy.High,
});
console.log('Location obtained:', location)
setLocation(location)
} catch (error) {
createAlert('حدث خطأ اثناء تحديد الموقع. يرجى المحاولة مرة أخرى');
console.log(error)
} finally {
setLocationLoading(false)
}
}