Describe the bug
I did a simple call to getLocation(), but it doesn't return anymore
Expected behavior
getLocation() returns an error or coordinates
Tested on:
Additional logs
When I made the call, I see the following:
W/GCoreFlp( 2013): No location to return for getLastLocation()
W/GCoreFlp( 2013): No location to return for getLastLocation()
W/GCoreFlp( 2013): No location to return for getLastLocation()
D/WifiService( 1539): acquireWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@12bce7c6}
D/WifiService( 1539): releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@12bce7c6}
D/WifiService( 1539): acquireWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@12bce7c6}
D/WifiService( 1539): releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@12bce7c6}
D/WifiService( 1539): acquireWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@12bce7c6}
D/WifiService( 1539): releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@12bce7c6}
Hello,
I want to add 2 more informations:
E/flutter ( 3640): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method hasPermission on channel lyokone/location)
E/flutter ( 3640): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getLocation on channel lyokone/location)
This is a big problem. Can you please verify yourself?
Thank you in advance
Hi,
we had the exact same issue while trying to get users location multiple times.
Our solution was to make a variable named lastLocation, where we would write users location every time that getLocation() has succeeded and set a timeout on getter with:
LocationData lastLocation; - as a global variable
Location().getLocation().timeout(Duration(seconds: 1), onTimeout: () => lastLocation);
I hope it helps.
Hello @Kristijan505,
thank you. I've implemented what you suggested to me.
Anyway I also want to add that the problem was due to the simulator with API 21. This one, is the only one that require the position to be setted from the simulator settings, and need also that the position don't need to be the standard one. If you don't change the default simulator position, the GPS is treated as deactivated even if you activated it from the phone settings (strange behavior).
Most helpful comment
Hi,
we had the exact same issue while trying to get users location multiple times.
Our solution was to make a variable named lastLocation, where we would write users location every time that getLocation() has succeeded and set a timeout on getter with:
LocationData lastLocation;- as a global variableLocation().getLocation().timeout(Duration(seconds: 1), onTimeout: () => lastLocation);I hope it helps.