flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

iOS - Calling getPositionStream() method while location services are enabled and then disabling location services in Settings crashes the app

Open Andrew-Tolentino opened this issue 6 years ago • 3 comments

🐛 Bug Report

Runner[3574:863495] LOCATION UPDATE FAILURE:Error reason: (null)Error description: The operation couldn’t be completed. (kCLErrorDomain error 1.)

Expected behavior

Reproduction steps

  1. Call getPositionStream() while location services enabled on application
  2. Go to Settings on the device and set: Allow Location Access - Never

The application then crashes. When switching to previous versions before 6.0, the application does not crash. When running the application on Xcode, I believe the error occurs on line 79 in he GeolocationHandler.m file.

Configuration

(base) Andrews-MacBook-Pro:Runner andrew$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.5 19F96, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 11.6) [✓] Android Studio (version 3.5) [!] IntelliJ IDEA Community Edition (version 2019.2.4) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [✓] VS Code (version 1.47.2) [✓] Connected device (2 available)

Version: 1.x 6.0.0+1

Platform:

  • [x] :iphone: iOS
  • [ ] :robot: Android

Andrew-Tolentino avatar Aug 31 '20 21:08 Andrew-Tolentino

similar issue, it was fine before v6

utpal-barman avatar Sep 01 '20 09:09 utpal-barman

@Andrew-Tolentino thank you very much for the clear bug report. You were 100% correct with the error being on line 79 in the GeolocationHandler.m file.

I have fixed the bug in PR #509 and will release a fix today!

mvanbeusekom avatar Sep 03 '20 13:09 mvanbeusekom

I have just release version 6.0.0+2 which fixes this problem. Thanks again for the report and the extensive information

mvanbeusekom avatar Sep 03 '20 14:09 mvanbeusekom