mapbox / mapbox/mapbox-maps-ios

Swift 6 support

Open
#2,224 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Xcode version: Xcode 16 beta 5
- iOS version: 17.x, 18 beta
- Devices affected: iPad
- Maps SDK Version: 11.5.2

## Observed behavior and steps to reproduce

When compiling and running with Swift 6, the mapbox SDK crashes reliably when downloading tile regions and style packs using the OfflineManager.

It appears to me that Mapbox iOS SDK is not compatible with Swift 6 compilation.

## Expected behavior

The SDK should be able to be used with an app compiled using Swift 6.

## Notes / preliminary analysis

It looks to me to opt out of Swift 6 until support is ready, Mapbox would need to follow these steps:
https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/swift6mode/

I'm don't have a deep understanding of creating and supporting packages so it could be that something else is required or that I am goofing something on my end.

## Additional links and references

The call stack isn't very meaningful to me but using breakpoints it is clear that calling `loadTileRegion` or `loadStylePack` is the proximate location of the crash.

I can't be sure from this but it looks like maybe there was some error in downloading the tile region in this case and reporting the error is the thing that crashed? Not sure.

com.mapbox.common.Unspecified Worker 1 (24): EXC_BREAKPOINT (code=1, subcode=0x101050448)

in:
internal func coreAPIClosureAdapter(

0 ??? 0x000000011ef089d4 0x0 + 4814047700
1 FlightPulse-App 0x0000000100528000 __debug_blank_executor_main + 0
2 libdispatch.dylib 0x00000001010503d0 _dispatch_assert_queue_fail + 0
3 libswift_Concurrency.dylib 0x00000001a7febb58 64890F8C-83E3-3941-B7A4-12FFAB6F3116 + 404312
4 FlightPulse-App.debug.dylib 0x00000001065a56d8 $s15FlightPulse_App24MapboxOfflineTileRegionsC08downloadF6Region33_337409C8DD1D1326470AACBCBB9FA0E7LL9stylePack7airport7optionsyAA0de5StyleQ10IdentifierV_AA7AirportVAA0dE15DownloadOptionsVtYaFyScCyyts5NeverOGXEfU_ys6ResultOySo07MBXTileI0Cs5Error_pGcfU_ + 508
5 FlightPulse-App.debug.dylib 0x0000000107d47a64 $ss6ResultOySo13MBXTileRegionCs5Error_pGIegg_AFIegn_TR + 40
() $R0 = {}

6 FlightPulse-App.debug.dylib 0x0000000107d41214 $s10MapboxMaps21coreAPIClosureAdapter3for4type17concreteErrorType9converterySo11MBXExpectedCyq0_04CoreiJ0Qy_GSgcys6ResultOyxs0I0_pGc_q0_mq_mxSgq0_ctAA0mI13RepresentableR_Rl0_CAJRLCr1_lFyALcfU_ + 348
7 FlightPulse-App.debug.dylib 0x0000000107d412ec $s10MapboxMaps21coreAPIClosureAdapter3for4type17concreteErrorType9converterySo11MBXExpectedCyq0_04CoreiJ0Qy_GSgcys6ResultOyxs0I0_pGc_q0_mq_mxSgq0_ctAA0mI13RepresentableR_Rl0_CAJRLCr1_lFyALcfU_TA + 84
8 FlightPulse-App.debug.dylib 0x0000000107d47c24 $sSo11MBXExpectedCySo13MBXTileRegionCSo0bC5ErrorCGIegg_AGIeyBy_TR + 64
9 MapboxCommon 0x00000001016865ec _ZN6mapbox7bindgen6mapbox6common22TileRegionLoadProgress5toCppEP25MBXTileRegionLoadProgress + 15164
10 MapboxCommon 0x00000001016a1bc4 _ZN6mapbox6common16TileStoreFactory11replaceImplENSt3__110unique_ptrINS1_4ImplENS2_14default_deleteIS4_EEEE + 5544
11 MapboxCommon 0x00000001016a4678 _ZN6mapbox6common16TileStoreFactory11replaceImplENSt3__110unique_ptrINS1_4ImplENS2_14default_deleteIS4_EEEE + 16476
12 MapboxCommon 0x00000001016a85ec _ZN6mapbox6common16TileStoreFactory11replaceImplENSt3__110unique_ptrINS1_4ImplENS2_14default_deleteIS4_EEEE + 32720
13 MapboxCommon 0x00000001016abcac _ZN6mapbox6common16TileStoreFactory11replaceImplENSt3__110unique_ptrINS1_4ImplENS2_14default_deleteIS4_EEEE + 46736
14 MapboxCommon 0x0000000101562a40 _ZN6mapbox6common25SystemInformationProvider20getSystemInformationEv + 11544
15 libsystem_pthread.dylib 0x0000000223b4037c _pthread_start + 136
16 libsystem_pthread.dylib 0x0000000223b3b494 thread_start + 8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with Xcode 16 beta 5 using the OfflineManager calls loadTileRegion and loadStylePack, then inspect the reported coreAPIClosureAdapter crash and its Swift concurrency context. Done means the SDK can be compiled with Swift 6 and these offline downloads no longer crash, including when download errors are reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.