flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

isLocationServiceEnabled = true but error "The location service on the device is disabled"

Open minhdanhsc opened this issue 4 years ago • 7 comments

🐛 Bug Report

I check my positioning is turned on and i have it on too. isLocationServiceEnabled return true. However, when using Geolocator.getCurrentPosition, it throws an error "The location service on the device is disabled". I use xiaomi note 8pro and geolocator: 6.1.13.

minhdanhsc avatar Feb 26 '21 06:02 minhdanhsc

same

yuanjinsongquyi avatar Mar 25 '21 05:03 yuanjinsongquyi

Can you provide your:

flutter doctor -v

I reproduced the issue on my Oppo Reno 2Z using the example application:

  • Granted location permission
  • Turned location on
  • Method shows expected behaviour

florissmit1 avatar Apr 09 '21 10:04 florissmit1

#631

bajajsahil avatar Apr 11 '21 06:04 bajajsahil

isLocationServiceEnabled still returns true on iOS when i set gps access to "never"

update: im using https://pub.dev/packages/location_permissions as a workaround

sooxt98 avatar Apr 11 '21 18:04 sooxt98

@sooxt98 Please show me the workaround example.

it-one-mm avatar May 21 '21 20:05 it-one-mm

bool serviceEnabled = await Geolocator.isLocationServiceEnabled(); always returns true. even, when it's in denaied forever mode.

ShohidulProgrammer avatar Jun 15 '21 09:06 ShohidulProgrammer

same here, any workarounds?

carlossilvaf avatar Dec 29 '21 17:12 carlossilvaf

Same, but in my case this error appears only on tablet emulators. If use android emulator, real device or genymotion - all fine.

storm265 avatar May 22 '23 14:05 storm265

It seems to us that this issue is no longer valid, or is solved in the meantime. Therefore, we will close this issue. Feel free to reopen the issue if it is still relevant or reappears. If so, in order to be able to reproduce this issue, please add the output of flutter doctor -v below.

TimHoogstrate avatar Aug 04 '23 08:08 TimHoogstrate