Skip to content
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

[Bug]: deprecated plugin warnings during build and "LOCATION UPDATE FAILURE:Error reason: (null)Error description: The operation couldn’t be completed. (kCLErrorDomain error 0.)" error #1546

Open
3 of 8 tasks
ohalukkarakaya opened this issue Jul 28, 2024 · 3 comments
Assignees
Labels
type: enhancement New feature or request

Comments

@ohalukkarakaya
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

  1. These warnings printed out to console while building app:
    /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:40:31: warning: 'authorizationStatus' is deprecated: first deprecated in macOS 11.0 [-Wdeprecated-declarations]
    return [CLLocationManager authorizationStatus];
    ^~~~~~~~~~~~~~~~~~~
    authorizationStatus
    In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
  • (CLAuthorizationStatus)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("-authorizationStatus", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
    ^
    /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:47:65: warning: 'authorizationStatus' is deprecated: first deprecated in macOS 11.0 [-Wdeprecated-declarations]
    CLAuthorizationStatus authorizationStatus = CLLocationManager.authorizationStatus;
    ^~~~~~~~~~~~~~~~~~~
    authorizationStatus
    In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
  • (CLAuthorizationStatus)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("-authorizationStatus", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
    ^
    /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:47:65: warning: 'authorizationStatus' is deprecated: first deprecated in macOS 11.0 [-Wdeprecated-declarations]
    CLAuthorizationStatus authorizationStatus = CLLocationManager.authorizationStatus;
    ^~~~~~~~~~~~~~~~~~~
    authorizationStatus
    In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
  • (CLAuthorizationStatus)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("-authorizationStatus", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
    ^
    /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:107:1: warning: implementing deprecated method [-Wdeprecated-implementations]
  • (void) locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
    ^
    In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
  • (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status API_DEPRECATED_WITH_REPLACEMENT("-locationManagerDidChangeAuthorization:", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
    ^
    4 warnings generated.
    /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/LocationServiceStreamHandler.m:36:1: warning: implementing deprecated method [-Wdeprecated-implementations]
  • (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status{
    ^
    In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/LocationServiceStreamHandler.m:9:
  • (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status API_DEPRECATED_WITH_REPLACEMENT("-locationManagerDidChangeAuthorization:", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
    ^
  1. when i used plugin to get geo location of the user, it never return location and printed this error to console: LOCATION UPDATE FAILURE:Error reason: (null)Error description: The operation couldn’t be completed. (kCLErrorDomain error 0.)

(It was working, i didn't change anything but just upgraded flutter sdk)

Expected results

not geting warnings during build and geting geo location data without any error

Actual results

warnings printed, couldn't get geo location

Code sample

These warning and error message printed out:

Code sample
/Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:40:31: warning: 'authorizationStatus' is deprecated: first deprecated in macOS 11.0 [-Wdeprecated-declarations]
    return [CLLocationManager authorizationStatus];
                              ^~~~~~~~~~~~~~~~~~~
                              authorizationStatus
In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
+ (CLAuthorizationStatus)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("-authorizationStatus", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
^
/Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:47:65: warning: 'authorizationStatus' is deprecated: first deprecated in macOS 11.0 [-Wdeprecated-declarations]
  CLAuthorizationStatus authorizationStatus = CLLocationManager.authorizationStatus;
                                                                ^~~~~~~~~~~~~~~~~~~
                                                                authorizationStatus
In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
+ (CLAuthorizationStatus)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("-authorizationStatus", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
^
/Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:47:65: warning: 'authorizationStatus' is deprecated: first deprecated in macOS 11.0 [-Wdeprecated-declarations]
  CLAuthorizationStatus authorizationStatus = CLLocationManager.authorizationStatus;
                                                                ^~~~~~~~~~~~~~~~~~~
                                                                authorizationStatus
In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
+ (CLAuthorizationStatus)authorizationStatus API_DEPRECATED_WITH_REPLACEMENT("-authorizationStatus", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
^
/Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.m:107:1: warning: implementing deprecated method [-Wdeprecated-implementations]
- (void) locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
^
In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/PermissionHandler.h:11:
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status API_DEPRECATED_WITH_REPLACEMENT("-locationManagerDidChangeAuthorization:", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
^
4 warnings generated.
/Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/LocationServiceStreamHandler.m:36:1: warning: implementing deprecated method [-Wdeprecated-implementations]
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status{
^
In module 'CoreLocation' imported from /Users/o.halukkarakaya/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/macos/Classes/Handlers/LocationServiceStreamHandler.m:9:
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status API_DEPRECATED_WITH_REPLACEMENT("-locationManagerDidChangeAuthorization:", ios(4.2, 14.0), macos(10.7, 11.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
^

2024-07-28 23:45:55.966 MY_PROJECT[19285:307656] LOCATION UPDATE FAILURE:Error reason: (null)Error description: The operation couldn’t be completed. (kCLErrorDomain error 0.)

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

^12.0.0

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-x64, locale tr-TR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.7)
[✓] VS Code (version 1.85.0)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!
@TimHoogstrate
Copy link
Contributor

Dear @ohalukkarakaya,

Thanks for your input. Regarding the error on macOS. Have you checked if you have an active Wifi connection? Otherwise the Mac cannot determine your location.

Furthermore, the deprecation warnings should be fixed by us.

Kind regards,

@TimHoogstrate TimHoogstrate self-assigned this Jul 30, 2024
@TimHoogstrate TimHoogstrate added the type: enhancement New feature or request label Jul 30, 2024
@alladyaditi
Copy link

LOCATION UPDATE FAILURE:Error reason: (null)Error description: The operation couldn’t be completed. (kCLErrorDomain error 1.)
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: The operation couldn’t be completed. (kCLErrorDomain error 1.)
#0 GeolocatorApple.getPositionStream. (package:geolocator_apple/src/geolocator_apple.dart:188:9)
#1 Stream.handleError. (dart:async/stream.dart:931:16)
#2 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:269:17)
#3 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:157:13)
#4 _RootZone.runBinaryGuarded (dart:async/zone.dart:1606:10)
#5 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:384:15)
#6 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:402:7)
#7 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:306:7)
#8 _ForwardingStreamSubscription._addError (dart:async/stream_pipe.dart:128:11)
#9 _ForwardingStream._handleError (dart:async/stream_pipe.dart:95:10)
#10 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:157:13)
#11 _RootZone.runBinaryGuarded (dart:async/zone.dart:1606:10)
#12 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:384:15)
#13 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:402:7)
#14 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:306:7)
#15 _SyncBroadcastStreamController._sendError. (dart:async/broadcast_stream_controller.dart:392:20)
#16 _BroadcastStreamController._forEachListener (dart:async/broadcast_stream_controller.dart:322:15)
#17 _SyncBroadcastStreamController._sendError (dart:async/broadcast_stream_controller.dart:391:5)
#18 _AsBroadcastStreamController.addError (dart:async/broadcast_stream_controller.dart:486:5)
#19 _RootZone.runBinaryGuarded (dart:async/zone.dart:1606:10)
#20 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:384:15)
#21 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:402:7)
#22 _DelayedError.perform (dart:async/stream_impl.dart:552:14)
#23 _PendingEvents.handleNext (dart:async/stream_impl.dart:646:11)
#24 _PendingEvents.schedule. (dart:async/stream_impl.dart:617:7)
#25 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#26 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5) I am getting the same issue for IOS for geolocator 12.0.0

@alladyaditi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants