Location Sensor Unable to retrieve location with cellular data

Hi Everyone,
I am unable to retrieve the location with the location sensor with cellular data. I can get the coordinates by using a Wi-Fi connection. When I use cellular data it doesn’t provide coordinates and reverse geocoding doesn’t work. I tried it both in the thinkable live app and the apk version of the app. The issue only applies to android, however. The code I’m using is attached below. Pls, guide me in fixing this issue.

1 Like

What is the error message saying?

1 Like

The error showing is Error: Location provider is unavailable. Make sure that location services are enabled. I cross-checked the app permission location it was on for the thunkable live app too. Now I’m trying it with a Wi-Fi connection and now it’s not showing the location again. This is not a device issue I tried it with at least 15-20 devices of my friends and family and most of them are facing the same issue it worked for only 2 devices out of 15. Can you tell me how can I fix this?

1 Like

The first step is to remove (uninstall) the app from the phone.
From Thunkable create a new APK and install it and try again.

1 Like

Hi,
I tried it in the live app and the apk app I got the same error as before.I made changes to my blocks
(basically removed the map component)

The image is attached below . It still didn’t work and the same error appeared this works perfectly on the live app for IOS device.

1 Like

Will create a sample app using GetCurrentLocation and test it on my phone to check.

1 Like

Yes, @aikansh.dua044gefzj you are correct.

There is a problem that needs Thunkable attention.

@domhnallohanlon @jane @webinar.dokter

1 Like

@staff

1 Like

Can you check the APK?

I checked it and found working most of the time.

1 Like

Hi, @muneer It doesnt work for me.
The blocks I am using are
image
The output


If its working for you can you share the apk with me for the same?

I tried using the apk too and got the same output

1 Like

I must say that the issue is not fully fixed. It now respond better in DnD but still does not work on StP.

I’m following up with Thunkable to see if it should be reported as a BUG or it’s something they can fix in a day or two.

As it is now Monday, let’s wait a while and will follow up again.

3 Likes

Today is also Labor Day which is a holiday in the U.S. so they may not be working today.

2 Likes

Happy Labor Day @tatiang . Enjoy your day.

Thanking you for the info.

3 Likes

Hi there,

Unfortunately, this seems to be an issue with Expo, who provide the framework we use to build apps.

You can see discussion of this behavior on Expo’s Github here.

Thunkable team member Jose has deployed a partial fix.

Depending on your version of Android, you may need to set EnableHighAccuracy to false for Location Sensor to work as expected on your device. I use Android 11 and I don’t need to do this, but Jose reports needing to do this for Location Sensor to work on Android 10.

Unfortunately, since this is an issue with Expo, this won’t be completely resolved until Expo deploy a fix of their own. They have promised for this fix to come out in Expo v43.

3 Likes

Thank you.
I tested it during the weekend and it was working fine. I use Android 9 and did not need to change anything in my project.

3 Likes

@muneer @jane
Hi, the location works but occasionaly for example I have attached a video below showing this I was thinking may be I could do a loop while error was there but wasn’t able to figure it out can anyone help me with that .
The link for the video

1 Like

I watched your video but could not see the error.

Can you test this
https://x.thunkable.com/projectPage/614a172ecc8c0700111750c0

The button will start / stop the timer which will get the location every second

1 Like

Hi,@muneer I tried your app it worked fine since it was made on DnD my app is made on default thunkbale platform .The error was that Location provider is unavailable, it continued to show that 3-4 times as shown in video at last it finally showed the location.I was thinking maybe I could use a loop to call the location till there was no error but wasn’t able to figure it out

1 Like

Let me build a quick project in StP (Snap to Place) UI and we both do the test.

1 Like

Here’s a still from the 0:03 mark in the video:

2 Likes