My location sensor is not working. I am using Android 12 on a Google Pixel 4a. Location access is turned on to fine location. This error happens in the companion as well as the exported APK.
Those are the blocks I use to visualize the user (the sensor is hooked up to a map component but also not working there except one time after installing the app, after that it fails to get the user location even after multiple minutes. The map does not move to my location).
This is the config of my location sensor
This is the config of my Map
If you have any ideas please tell me!
Maybe it is a permission issue, see
So changing it to coarse may help with the problem? I´ll quickly change the apps permissions and edit this after.
Edit: This is what happens if I deny the fine location:
So nope, turning it to coarse does not fix the issue
Thanks, but the permission is requested properly if not given. I just turned it to coarse to see if that helps.
Don’t have an android 12 device to check so…Also read this
The question is if locations on Android 12 have been implemented if that´s necessary. If no that would surprise me since they was a Beta out for a long time now.
Have you read the tutorial Using the Location Sensor and loaded and tested the two aia Projects.
That may provide you an explanation.
Thank you! Using the sample projects leads to “internal error”, but I understood the basics. My issue is that the location sensor works but gives me obviously wrong data with locations multiple Kilometers away, even after allowing the fine location.
the example projects are App Inventor projects… you might have to adjust them to fix the Kodular issues
Thanks! I just ran it in the MIT AI2 companion. It shows this:
entering the location on google maps, the data is extremely accurate.
Doing the same with Kodular results in a great positioning, but only after closing the app, turning “fine location access” on and off in the settings and reentering. When closing the app again, the fine location permission is still given but my location is about 3km off to the north. Any ideas how to fix this? It also does not work after using a Fake GPS application with it enabled in the developer settings.
Ok, I figured something out.
This is how I can get it to work for one session (app open → app close):
- Open app (location wont work)
- Open settings for that app, turn off fine location
- Go back to the app, allow fine location
That makes it work once. When reopening the app later, it does not work anymore and you have to repeat those steps. Any ideas?
This is my app init:
Location sensor config: