-
-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"getLocation()" never returns #172
Comments
i have same issue: if i haven't enabled GPS when try to getLocation(), i confirm the request for enable it, but getLocation() never return, if i try again this work correctly |
Hey ! I'll look into this over the weekend. Don't hesitate to use the authorisation process from the sample app in the mean time :) |
Hi @Lyokone , Thanks for this wonderful plugin. Please fix or suggest or suggest an alternate meanwhile. Thanks, |
Hey ! Spent most of my time on the background location feature this weekend, so wasn't able to look into this. A simple workaround would be to use |
I've tested your sollution with |
Thanks for the great work, unfortunately having the same problem. I upgraded from v1.2.0 which worked fine to v2.3.5 recently and started having this problem. Tried each version between 2.0.0 and 2.3.5 and also tried |
Hey ! This is really strange since I'm having no problem on my end during testing and using the plugin in projects. Have you updated everything ? Can you launch |
Thanks for any help you can provide, here's what I hope is near the beginning of the relevant logs using
|
Any news? I'm facing the same issue. |
Hey, I've been unable to reproduce this error on my end for now. Is the
sample project working correctly for you ?
Le dim. 28 avr. 2019 à 16:29, Vito <[email protected]> a écrit :
… Any news? I'm facing the same issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#172 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA4COAXLH5HSZ67QUYWRJHTPSWYC3ANCNFSM4HG7JFAQ>
.
|
I flashed a new custom ROM (Android Pie) on my phone, and now it works, and neither do I cannot reproduce the bug now. I'm going to try to reproduce it these days. By the way, could it be a MIUI related issue? |
Happy to know 😁
Can any other participant of the thread tell if they are using custom ROMs
?
Le dim. 28 avr. 2019 à 18:30, Vito <[email protected]> a écrit :
… I flashed a new custom ROM (Android Pie) on my phone, and now it works,
and neither do I cannot reproduce the bug now. I'm going to try to
reproduce it these days.
By the way, could it be a MIUI related issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#172 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA4COAXQ4YZTRT3ZITDVXTLPSXGI3ANCNFSM4HG7JFAQ>
.
|
@Lyokone I use PIXEL 2 XL with original OS |
I am using stock Xiami Mi A2 and stock Motorola Moto G5S. |
I'm also using stock on the pixel 1, Android 9. |
So a lot of different devices, Pixels especially should be fine. Is the sample app working properly for you ? Maybe the plugin isn't returning a proper error of something you would be missing. |
Same issue on meizu M5 note w/ stock rom on the latest update |
The app is not crashing but it is giving null on getLocation() `LocationData _currentLocation; Location _location; Future getLoc() async {
}` gradle.properties
gradle.build E/flutter (26075): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method 'getLocation' was called on null. |
@sarimk80 |
Just to give another update on this issue, I took care of the problems by handling permissions another way before calling Seems like the problem I was having was about handling permissions properly? Sorry I have not ran into the problem in the example app, as far as I can recall it worked fine. |
I am also having this issue. Requesting permissions first, then on confirm of permissions, calling getLocation() |
I'm having the same issue here. When I call |
Call the future method in future builder this method work for me ` LocationData _currentLocation; Location _location = Location(); Future getLoc() async {
}` Try calling future with Future Builder `body: FutureBuilder(
|
I need to load my data out of a widget. I've tried to load using Future but it ins't work. |
I figured out why it was not working for me. requestPermission was not getting called. After debugging it I found another plugin (device_calendar) was blindly returning true in their permissions handler even though it was for a different permission. Thus flutter was not calling the handler for location. Here is a link to the related issue: builttoroam/device_calendar#79 |
Hey ! Thanks for finding that, I'll see if I can better isolate my requests to not get handled by other plugins methods ! |
Really looking forward. |
Yhea it seems to be a builttoroam's package issue, can someone please fix it? |
@Banglemoose Using LocationAccuracy.LOW for me is a no. It forces me to open my wifi even if I am not connected to any network. Is there anyway to prevent it from asking for wifi accessibility? |
Is there a solution ? version 2.3.5 continues with same problem |
Hello , any news? we are also looking for a solution we want to make a routing app but we can not track our location |
It seems that the repository is no longer maintained. I now use flutter-geolocator and it works fine. |
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. |
Sounds related to #239. |
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. |
I'm seeing this issue on iOS now. |
I'm seeing this on IOS as well. |
Same problem here in iOS and changing the accuracy to low doesn't work for me |
For those who still having this issue I'm using this workaround:
This works and is what I'm currently using in prodution. Let me know if this helps you in any way. |
@pedromassango also have this solution in place for several Flutter apps but it's extremely poor. Seeing the issue on our iOS apps for Reach-Native. |
@Lyokone do you have plans to use another package for permission requests? |
Still the same issue I think I will use flutter-geolocator https://pub.dev/packages/geolocator |
same issue |
Same issue with me in macos app. Solved by enabling WIFI connection in mac settings. Flutter doctor
|
location.changeSettings(accuracy: LocationAccuracy.low) worked for me #172 (comment) |
This is not a solution if you need a high accuracy location data. |
Still an issue tried |
Still getting the same issue even after this workaround.. (Tried in both miui & lineage)
|
The problem was occurring here always after than I ask to enable location service. To resolve it, I put an await Future.delayed(Duration(seconds: 1)) before of getLocation() and it works for me. |
The same problem still occurs, even tho I put a delay between I was using an other package to request permission from user, but for better compatibility (with IOS) I switched to use in-package permission request. When ever I request permission then wait for a location event (or just use getLocation) there wont be any event occurs. The problem occurs both Android Emulator & IOS Simulator devices, and as I remember even with the other package to get permissions and a physical device and the release build, the first request always takes some time. But this time I wait for way too long that nothing happen. I guess even tho the FIX: now I switched to @Lyokone any suggestions ? |
Hey everyone! Here's a snippet of how I implemented it:
It's not a perfect solution, but it might be a helpful bandaid for folks who are stuck. Hopefully, this issue can be resolved soon with a more permanent fix! |
(First of all, thanks for your hardwork at this library)
Describe the bug
I am calling this method before calling "runApp(MyApp())" in my main method. I need this because my app needs a current known location at its very first frame:
The call gets stuck on the last line of this method, never returning a proper position.
I am using library version
2.3.5
withflutter 1.2.1
Expected behavior
The method should return a position.
Tested on:
The text was updated successfully, but these errors were encountered: