-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
get Current Location Null #248
Comments
Me Too. My Code:
Output: My phone is not installed Google Play Store and Google Play Service |
Try the latest |
@BhaveshPrince, @xuanjinliang, does this issue still occur with the latest version (5.0.0) of the @xuanjinliang, if you don't have Google Play Store you can try forcing (although this should be done automatically) the plugin to use the legacy try {
final Geolocator geolocator = Geolocator()
..forceAndroidLocationManager = true;
position = await geolocator.getLastKnownPosition(
desiredAccuracy: LocationAccuracy.best);
} on PlatformException {
position = null;
} |
@mvanbeusekom used to work perfectly but got an error earlier. Just hangs without returning back any results. |
Had the same behaviour with expand``` W/GooglePlayServicesUtil(29584): Google Play Store is missing. E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): Failed to handle method call E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at com.baseflow.geolocator.data.LocationOptions.parseArguments(LocationOptions.java:17) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at com.baseflow.geolocator.tasks.TaskFactory.createCurrentLocationTask(TaskFactory.java:36) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at com.baseflow.geolocator.GeolocatorPlugin.onMethodCall(GeolocatorPlugin.java:66) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:219) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at android.os.MessageQueue.next(MessageQueue.java:326) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at android.os.Looper.loop(Looper.java:160) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at android.app.ActivityThread.main(ActivityThread.java:6718) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/MethodChannel#flutter.baseflow.com/geolocator/methods(29584): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) E/flutter (29584): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, java.lang.String cannot be cast to java.util.Map, null) E/flutter (29584): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) E/flutter (29584): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33) E/flutter (29584): E/flutter (29584): #2 Geolocator.getCurrentPosition (package:geolocator/geolocator.dart:96:32) E/flutter (29584): E/flutter (29584): #3 MapPageState.createVendingLocation (package:eismann/pages/mapPage.dart:71:44) E/flutter (29584): E/flutter (29584): #4 MapGestureMixin.handleTap (package:flutter_map/src/gestures/gestures.dart:94:13) E/flutter (29584): #5 _TapPositionDetectorState._postCallback (package:positioned_tap_detector/positioned_tap_detector.dart:108:15) E/flutter (29584): E/flutter (29584): #6 _TapPositionDetectorState._onTimeout (package:positioned_tap_detector/positioned_tap_detector.dart:52:7) E/flutter (29584): #7 _invokeErrorHandler (dart:async/async_error.dart:17:29) E/flutter (29584): #8 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:286:9) E/flutter (29584): #9 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:168:13) E/flutter (29584): #10 _rootRunBinary (dart:async/zone.dart:1144:38) E/flutter (29584): #11 _CustomZone.runBinary (dart:async/zone.dart:1037:19) E/flutter (29584): #12 _CustomZone.runBinaryGuarded (dart:async/zone.dart:939:7) E/flutter (29584): #13 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:355:15) E/flutter (29584): #14 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373:16) E/flutter (29584): #15 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:272:7) E/flutter (29584): #16 _SyncStreamController._sendError (dart:async/stream_controller.dart:768:19) E/flutter (29584): #17 _StreamController._addError (dart:async/stream_controller.dart:648:7) E/flutter (29584): #18 _StreamController.addError (dart:async/stream_controller.dart:600:5) E/flutter (29584): #19 Stream.timeout.onListen. (dart:async/stream.dart:1512:22) E/flutter (29584): #20 _rootRun (dart:async/zone.dart:1124:13) E/flutter (29584): #21 _CustomZone.run (dart:async/zone.dart:1021:19) E/flutter (29584): #22 _CustomZone.bindCallback. (dart:async/zone.dart:947:23) E/flutter (29584): #23 Timer._createTimer. (dart:async-patch/timer_patch.dart:21:15) E/flutter (29584): #24 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19) E/flutter (29584): #25 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5) E/flutter (29584): #26 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12) ``` locationOptions: {\"accuracy\":\"high\",\"distanceFilter\":0,\"forceAndroidLocationManager\":true,\"timeInterval\":0} Update:Got it working after I upgraded |
thanks @FalkF ! |
Commenting out this line |
@xuanjinliang ,me too,If you solve this problem, I hope you can tell me. |
Issues should be solved with version 6.0.0 |
geolocator: ^7.0.3 forceAndroidLocationManager - does not find such a method in class Geolocator. |
@kostasoft Since version 6.0.0 the Meaning from version 6.0.0 you can force the use of the Position position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high,
forceAndroidLocationManager: true,
); |
Thank you. I did as you said, still an error: |
Just a sanity check, you used |
This is incorrect, In this case the phone doesn't support Google Play Services and therefore is unable to use the |
In any case, the plugin requires the Google Play Store (in the logs) and the location is not detected. |
Hi, I have the same problem runing the example, giving permisions etc.. |
Same issue here. can we reopen this issue? because It has not been resolved yet. Thanks in advance |
same issue current location not get...plz help |
not working sir |
I have the same problem runing the example; Google Play Store is missing |
Hello Sir,
while i run app into android platform getting location null.
Please helm me
The text was updated successfully, but these errors were encountered: