Repository navigation
Description
Environment
- Xcode version: 26.6
- iOS version: 26.6.2 (the event below); the code path is the same on every iOS version
- Devices affected: iPhone 14 Plus (iPhone14,7) in this event; any device can hit it, because the call blocks on
locationd - Maps SDK Version: 11.23.1, through
@rnmapbox/maps10.3.5. The same read is still onmain(11.33.0).
Observed behavior and steps to reproduce
Creating a MapView reads CLLocationManager.accuracyAuthorization on the main thread. That getter is a synchronous XPC call to locationd. When locationd is slow to answer, the main thread blocks: our Sentry app-hang reports show 2.8–3.6 s with the main thread fully blocked.
The map never shows the user's location, and the app never asks for location permission. The read happens only because MapView.init builds the default location provider.
Steps: create a MapView on the main thread (any app; ours is a React Native app through @rnmapbox/maps). The read happens every time. The hang happens when locationd is slow, which we see in production a few times a month.
Main thread, from the app-hang report (innermost first):
mach_msg2_trap
xpc_connection_send_message_with_reply_sync
__NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__
-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]
CLGetUncertaintyScaleFactors
CLSetClientTransientAuthorizationInfo
CLClientGetLocation
CLLocationManager.accuracyAuthorization.getter
AppleLocationProvider.init
LocationDataModel.createDefault
MapView.setupManagers
MapView.commonInit
MapView.init
RNMBXMapView.createMapView
The read is Sources/MapboxMaps/Location/AppleLocationProvider.swift line 171 on main:
self.latestLocationAndAccuracyAuth = ([], locationManager.accuracyAuthorization)Expected behavior
Creating a map view does not make a synchronous call to locationd on the main thread, at least while the map does not use location. Apple's documentation for CLLocationManager warns that its synchronous authorization reads can make the UI unresponsive when called on the main thread.
Notes / preliminary analysis
Two possible fixes:
- Create the default location provider lazily, on the first use of location (a puck, a location consumer, or
mapView.location), not inMapView.init. - Do not read
accuracyAuthorizationinAppleLocationProvider.init. Take the value fromlocationManagerDidChangeAuthorization(_:), which Core Location calls when the manager is created.
@rnmapbox/maps has a second copy of this read (its RNMBXLocationModule creates an AppleLocationProvider when the package loads). We have a patch for that side, and we will offer it to rnmapbox separately. That patch cannot reach the read in MapView.init.
Additional links and references
AppleLocationProvider.swiftline 171 onmain: https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Location/AppleLocationProvider.swift#L171
Activity
AlexandrBasan commentedon Nov 17, 2026
We also have the same issue