iOS - Calling getPositionStream() method while location services are enabled and then disabling location services in Settings crashes the app
🐛 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
- Call getPositionStream() while location services enabled on application
- 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
similar issue, it was fine before v6
@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!
I have just release version 6.0.0+2 which fixes this problem. Thanks again for the report and the extensive information