Baseflow / flutter-geolocator

Android and iOS Geolocation plugin for Flutter
https://baseflow.com/
MIT License
1.24k stars 651 forks source link

Service not working on a Device with no google services #337

Closed JoseGeorges8 closed 5 years ago

JoseGeorges8 commented 5 years ago

🐛 Bug Report

I'm trying to get location on a device that does not have google play services (Model is TC56) but it does not work. I'm forcing the usage of the Location Manager.

Expected behavior

Expected to get the location

Reproduction steps

  1. Get a device with no google services
  2. Create a quick example project with this plugin on
  3. Run the following code at any point
    final Geolocator _geo = Geolocator();
    _geo.forceAndroidLocationManager = true;
    try{
      Position position = await _geo.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
      return position;
    }catch(e){
      throw(e.toString());
    }
  4. Nothing will happen. Following debug points the call stops right here: final Map<dynamic, dynamic> positionMap = await _methodChannel.invokeMethod('getCurrentPosition', Codec.encodeLocationOptions(locationOptions));

inside the getCurrentPosition method

Configuration

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, v1.10.7, on Mac OS X 10.14.3 18D109, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.38.1)
[✓] Connected device (2 available)

• No issues found!

plugins inside the project:

 cupertino_icons: ^0.1.2
  path_provider:  ^1.1.0
  rflutter_alert: ^1.0.2
  http: ^0.12.0+2
  dio: ^2.1.0
  device_info: ^0.4.0+1
  positioned_tap_detector: ^1.0.2
  barcode_scan: ^1.0.0
  camera: ^0.5.2+2
  sqflite: ^1.1.0
  synchronized: ^2.1.0
  flutter_launcher_icons: ^0.7.3
  firebase_core: ^0.4.0+9
  firebase_analytics: ^5.0.2
  flutter_crashlytics: ^1.0.0
  firebase_messaging: ^5.1.4
  url_launcher: ^5.0.2
  shared_preferences: ^0.5.3+1
  google_maps_flutter: ^0.5.21+3
  auto_size_text: ^2.0.2+1
  flutter_spinkit: ^4.0.0
  flare_flutter: ^1.5.6
  cached_network_image: ^1.1.1
  async:
  store_redirect: ^1.0.1
  transparent_image: ^1.0.0
  package_info: ^0.4.0+3
  intl: 0.16.0
  flushbar: ^1.9.0
  connectivity: ^0.4.4
  exif: ^1.0.1
  carousel_slider: ^1.3.1
  flutter_image_compress: ^0.6.3
  geolocator: ^5.1.4+1

Version: ^5.1.4+1

Platform:

JoseGeorges8 commented 5 years ago

Really silly mistake, I did not have the location services on lol... I'll close the issue but feel free to delete it instead.