Why is my geolocation tool completely stuck on Android?

Author
Owen Miller Author
|
3 weeks ago Asked
|
62 Views
|
2 Replies
0

Urgent Problem: I am completely stuck and incredibly frustrated. My 'What is My Location?' web tool, which is supposed to provide current coordinates and map location, is completely failing to get any geolocation data on Android devices. It just gets stuck indefinitely when trying to initiate location tracking.

Tool Context:

  • Our tool's core purpose is to find current coordinates and map a user's location using the browser's geolocation API.
  • It works perfectly on desktop browsers (Chrome, Firefox, Safari) and even on iOS devices without any issues whatsoever.

What I've Tried (and Failed):

  • I've tested this extensively on multiple Android devices, including a Samsung S23 and a Pixel 7, running various Android versions (12, 13).
  • I've tried different browsers on Android: Chrome, Firefox, and Brave. The behavior is consistent across all of them.
  • I've cleared browser cache and data repeatedly on all test devices, thinking it might be a cached permission or setting. No luck.
  • I've double-checked device location permissions โ€“ they are unequivocally enabled for the browser apps themselves.
  • I've confirmed that SSL is active (HTTPS) on our domain, which is a common requirement for the Geolocation API.
  • I even added a timeout to getCurrentPosition (e.g., 10 seconds), but it just hits the timeout without triggering any error or success callback.
  • Crucially, no specific error callbacks are being triggered from getCurrentPosition's error handler. It's just silent.

Specific Observations:

  • The browser does not even prompt for location permission on Android devices; it simply hangs indefinitely. This is a major red flag.
  • There are no console errors visible when I perform remote debugging via Chrome DevTools. The console remains completely silent.
  • It's like navigator.geolocation.getCurrentPosition() is silently failing or waiting for some internal Android-level permission or service that never responds.

My Frustration & Request for Help: I've been banging my head against this for hours, trying everything I can think of. This is absolutely critical for our tool's mobile usability and overall functionality. What on earth could be causing the geolocation API to completely freeze up on Android specifically, preventing any kind of location tracking? Are there any obscure Android security settings, browser flags, or recent API changes I'm missing that would cause this very specific, silent, and indefinite hanging behavior?

2 Answers

0
MD Alamgir Hossain Nahid
Answered 2 weeks ago
The browser does not even prompt for location permission on Android devices; it simply hangs indefinitely.

This is a classic head-scratcher, and trust me, we've all pulled our hair out over silent Geolocation API failures on Android. When the browser isn't even prompting, the issue almost invariably points to the Android device's global mobile location services being disabled or set to a highly restrictive mode (like "Wi-Fi & Bluetooth scanning off") at the OS level, rather than just the browser's app permissions. Ensure the device's main Location setting is fully enabled and set to a high-accuracy mode, as this often overrides or prevents the browser from even initiating the request, leading to that frustrating indefinite hang and bypassing typical browser API limitations.

Are you seeing this behavior consistently across all Android device models and versions, even after verifying the global location setting?

0
Owen Miller
Answered 2 weeks ago

OMG that makes so much sense, I've been stuck on this forever, thank you!!!

Your Answer

You must Log In to post an answer and earn reputation.