[Location Plugin] GetLocation always has error Timeout expired on Android
Forge component by Platform Maintenace


I\m using GetLocation widget to detect if GPS is enabled on device and we can get its location. OniOS its working ok, but on Android I always have error "Timeout expired". I've tried increase timeout to 10000 and disable HighAccuracy but result is the same.

What can be the reason?

Any other way to detect if GPS is enabled on device?

Thank you


I have the same problem.. but the thing is that it works on almost every Android with an exception of one model:

M3Mobile M3SM15N 7.1.1

The Location permission is enable and the GPS is working because on native Google Maps native app it's working.

Any ideas?

Best regards,
Tiago Lopes

Hello OutSystems Community, 

We have recently been analysing this "Timeout expired" error that can be returned when using the Location Plugin.

We believe that this error is returned when the application cannot retrieve the location within the specified timeout. Moreover, this error is returned when the timeout expires and the application could not connect to the native Android side of the plugin. In this scenario, the web Geolocation API will be used. For example, when running the application (that uses the Location plugin) as a PWA (Progressive Web App), if the timeout value provided is too low, the "Timeout expired" error will be returned. This is because the web Geolocation API will be used to get the location of the device. 

When running the application as a mobile app in an Android device, if the location cannot be retrieved in time, a "Position retrieval timed out" error will be returned, instead of the "Timeout expired" error.

Finally, we recommend using a higher value for the timeout parameter.

We hope this answer helps.

Best regards,

Alexandre Jacinto

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.