flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

await location.getLocation() some times getting null in iOS devices

Open mohammednabil95 opened this issue 3 years ago • 22 comments

More than one month I am using location package, in android devices it is working fine but in iOS physical device or simulator some times it is not working. I debug it and found that it is getting null on await location.getLocation();

Location location = new Location(); LocationData _locationData; _locationData = await location.getLocation(); // Getting null on this line

mohammednabil95 avatar Nov 13 '21 17:11 mohammednabil95

Same issue. I have also seen it take a realllly long time to return, like 10 to 15 seconds.

zerox1212 avatar Nov 18 '21 03:11 zerox1212

From my side when it goes to await.getLocation(); it does not return it stays there forever unless I rerun the app and sometimes it shows null

mohammednabil95 avatar Nov 18 '21 08:11 mohammednabil95

@mohammednabil95 do you have a distanceFilter set greater than 0?

sandersaelmans avatar Nov 26 '21 07:11 sandersaelmans

@sandersaelmans I cannot find distanceFilter in this library.

mohammednabil95 avatar Nov 26 '21 13:11 mohammednabil95

@sandersaelmans I cannot find distanceFilter in this library.

https://github.com/Lyokone/flutterlocation/blob/ab79cba664284ee44ed3f7076c1c2b3038187afc/packages/location/lib/location.dart#L30

sandersaelmans avatar Dec 09 '21 07:12 sandersaelmans

Same issue. I have also seen it take a realllly long time to return, like 10 to 15 seconds.

same happening for me . Do you found any solution for this?

deepakrana0011 avatar Dec 17 '21 11:12 deepakrana0011

+1

DanielSmith1239 avatar Dec 19 '21 18:12 DanielSmith1239

+1

tr0jan666 avatar Dec 28 '21 08:12 tr0jan666

same problem

tr0jan666 avatar Dec 28 '21 10:12 tr0jan666

same issue not working

mitesh77 avatar Jan 07 '22 19:01 mitesh77

There seems to be a major issue. getLocation() works first time. When it is asking for permission. But after that if I restart the app it gets stuck in this line _locationData = await location.getLocation(); Package version: 4.2.0 Flutter version: 2.8.0

momshaddinury avatar Jan 12 '22 04:01 momshaddinury

I solved it temporarily it's only we face because of ios simulator not working great for this dependency in a flutter. if select city run or change correct location then it will work. Screenshot 2022-01-12 at 11 54 36 AM

mitesh77 avatar Jan 12 '22 06:01 mitesh77

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 17:04 stale[bot]

From my side when it goes to await.getLocation(); it does not return it stays there forever unless I rerun the app and sometimes it shows null

I'm experiencing this same issue. Has anyone found a solution for this as yet?

Deandrew007 avatar Apr 21 '22 17:04 Deandrew007

I have the same problem, how can I solve it?

m2sahin avatar Jul 04 '22 11:07 m2sahin

Same problem.

hashirshoaeb avatar Jul 06 '22 17:07 hashirshoaeb

same problem.. I change between 2 localizations in emulator and then refresh, but I don't know if that can happen in real

jlopezrod avatar Jul 23 '22 19:07 jlopezrod

I switched out location package for geolocator after many failed attempted tries to resolve the issue.

https://pub.dev/packages/geolocator

Deandrew007 avatar Jul 25 '22 05:07 Deandrew007

I switched out location package for geolocator after many failed attempted tries to resolve the issue.

https://pub.dev/packages/geolocator

did it work? or faced new error?

hashirshoaeb avatar Jul 25 '22 06:07 hashirshoaeb

Being working well since I started using it in May.

Deandrew007 avatar Jul 25 '22 06:07 Deandrew007

Same Issue

vmwsree avatar Nov 25 '22 11:11 vmwsree

some users response similar issue. However, we cannot reproduce the issue... :(

derjohng avatar Jan 10 '23 09:01 derjohng