-
Notifications
You must be signed in to change notification settings - Fork 318
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
Crash on launch — +[NSUserDefaults mme_configuration]: unrecognized selector — conflicting MapboxMobileEvents dependency in Carthage #2299
Comments
cc: @julianrex FYI |
Fantastic catch, @1ec5! |
See also mapbox/mapbox-gl-native-ios#121 |
In addition to upgrading master to map SDK v5.6.0, semver technically requires us to patch each minor release we’ve put out since #2208, which would be v0.38 and v0.37. |
A workaround is available in mapbox/mapbox-gl-native-ios#121 (comment): specify this dependency in your Cartfile and run
The workaround can be removed once the navigation SDK migrates to the latest MapboxMobileEvents version, but you’ll need to use this workaround again every time there’s a gap between map SDK and navigation SDK releases. |
v0.37.1 and v0.38.2 have been released. These patch releases mitigate the crash for any Carthage-powered project whose Cartfile depends on The same is true for CocoaPods-powered projects whose Podfile depends on Projects that specify Projects that depend on master are also affected for now, but #2302 will upgrade both the map SDK and MapboxMobileEvents dependencies in unison. |
#2302 fixes the crash on master. mapbox/mapbox-gl-native-ios#143 proposes a way to keep these version conflicts from occurring in the future. |
@chezzdev pointed out that Carthage interprets This actually results in a Carthage.resolved that pulls in v5.6.1 of the map SDK: mapbox-navigation-ios/Cartfile Line 1 in 4717f2f
|
Fixed for real in #2317. |
An application that installs this SDK via Carthage is guaranteed to crash as soon as an access token is provided to MapboxMobileEvents, which typically happens on launch.
Diagnosis
As of #2208, MapboxNavigation depends on map SDK v5.2.0–v5.x. As of mapbox/mapbox-gl-native-ios#60, the map SDK depends on a copy of MapboxMobileEvents provided by CocoaPods or Carthage rather than an embedded, statically-linked copy. This change made it into v5.6.0, a minor version update.
Since the map SDK is distributed as a binary artifact via a JSON manifest and
binary
specification, Carthage doesn’t handle this dependency; instead, clients of the map SDK are expected to explicitly depend on MapboxMobileEvents. MapboxCoreNavigation has long depended on MapboxMobileEvents, but it currently depends on v0.9.5, whereas the map SDK apparently requires v0.10.0–v0.10.x for Carthage (but specifically v0.10.2 for CocoaPods).Carthage does nothing to resolve this incompatibility; instead, the application crashes at runtime:
Resolution
The crash occurs after running
carthage update
, as @avi-c did in #2296. A temporary workaround is to only runcarthage bootstrap
with a checked-in Carthage.resolved that sticks to map SDK v5.5.0.As a matter of good hygiene, we should upgrade MapboxCoreNavigation to v0.10.2. We may also need to patch v0.38.1 to require specifically map SDK v5.5.x. However, this problem will recur every time the navigation SDK or map SDK needs a new version of MapboxMobileEvents, because the map SDK essentially relies on an implicit dependency with no safeguards around dependency versions.
/cc @mapbox/navigation-ios @mapbox/maps-ios @mapbox/mobile-telemetry
The text was updated successfully, but these errors were encountered: