Locations not working with Android 5.1

Please provide the following:

  1. SDK Version: 39
  2. Platforms(Android/iOS/web/all): Android

Im working in expo SDK 39 and with android 5.1, whenever i use “Location.getCurrentPositionAsync({ accuracy: Location.Accuracy.Highest, })” i get the error message “Location provider is unavailable. Make sure that location services are enabled.”

CODE BELOW:

    let { status } = await Location.requestPermissionsAsync();
    if (status !== 'granted') {
        console.log('Permission to access location was denied');
    } else {
        try {
            let location = await Location.getCurrentPositionAsync({ accuracy: Location.Accuracy.Highest, }); 
            if (location) {
                console.log('location',location)
            }
        } catch (err) {
            console.log('error', err)
        }
    }

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.