@jacques_gordon/expo-mapbox-navigation 2.2.9 → 2.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app.plugin.js CHANGED
@@ -216,13 +216,44 @@ def _expo_mapbox_nav_add_spm(installer)
216
216
  end
217
217
  pods_project.save
218
218
 
219
- # ── NOTE: We do NOT add products to the user app target ────────────────────
220
- # Adding MapboxNavigationCore/UIKit directly to the app target causes
221
- # "Multiple commands produce" errors for MapboxCommon, MapboxCoreMaps, Turf
222
- # because @rnmapbox/maps already embeds them via CocoaPods/SPM.
223
- # The ExpoMapboxNavigation pod target is sufficient: when CocoaPods links
224
- # the pod into the app, SPM resolves the transitive dependencies correctly
225
- # without re-embedding them.
219
+ # ── Step 2: Add package REFERENCE to user_project (NOT products) ────────────
220
+ # Critical distinction learned from build logs:
221
+ #
222
+ # v2.2.8 (Step 2 with products on user target):
223
+ # SPM resolved correctly
224
+ # But caused "Multiple commands produce MapboxCommon/Turf/MapboxCoreMaps"
225
+ # Because @rnmapbox/maps already embeds those transitive dependencies
226
+ #
227
+ # v2.2.9 (Step 2 removed entirely):
228
+ # → No "Multiple commands produce" ✅
229
+ # → But "Missing package product MapboxNavigationCore/UIKit" ❌
230
+ # → Because Pods.xcodeproj is rebuilt by CocoaPods each time, so the
231
+ # package reference injected into pods_project does not persist.
232
+ # Without a reference in user_project (Navio.xcodeproj, which persists),
233
+ # Xcode does not resolve the SPM package and the products are not found.
234
+ #
235
+ # v2.2.10 (this version — package reference only in user_project):
236
+ # → Add ONLY the XCRemoteSwiftPackageReference to user_project ✅
237
+ # → Do NOT add XCSwiftPackageProductDependency to user_target ✅
238
+ # → This registers the package in the Xcode workspace SPM graph so it
239
+ # gets resolved and downloaded, without embedding its frameworks again.
240
+ installer.aggregate_targets.each do |agg|
241
+ user_project = agg.user_project
242
+
243
+ # Add only the package reference — not the product dependencies
244
+ user_pkg = user_project.root_object.package_references.find { |p|
245
+ p.class == pkg_class && p.repositoryURL == url
246
+ }
247
+ unless user_pkg
248
+ user_pkg = user_project.new(pkg_class)
249
+ user_pkg.repositoryURL = url
250
+ user_pkg.requirement = requirement
251
+ user_project.root_object.package_references << user_pkg
252
+ puts "[ExpoMapboxNavigation] Registered mapbox-navigation-ios in #{user_project.path.basename}"
253
+ end
254
+
255
+ user_project.save
256
+ end
226
257
  end
227
258
  `;
228
259
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jacques_gordon/expo-mapbox-navigation",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "description": "Expo module for Mapbox Navigation SDK with 16KB page size support, NDK27, and Mapbox Maps v11.11.0+",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -216,13 +216,44 @@ def _expo_mapbox_nav_add_spm(installer)
216
216
  end
217
217
  pods_project.save
218
218
 
219
- # ── NOTE: We do NOT add products to the user app target ────────────────────
220
- # Adding MapboxNavigationCore/UIKit directly to the app target causes
221
- # "Multiple commands produce" errors for MapboxCommon, MapboxCoreMaps, Turf
222
- # because @rnmapbox/maps already embeds them via CocoaPods/SPM.
223
- # The ExpoMapboxNavigation pod target is sufficient: when CocoaPods links
224
- # the pod into the app, SPM resolves the transitive dependencies correctly
225
- # without re-embedding them.
219
+ # ── Step 2: Add package REFERENCE to user_project (NOT products) ────────────
220
+ # Critical distinction learned from build logs:
221
+ #
222
+ # v2.2.8 (Step 2 with products on user target):
223
+ # SPM resolved correctly
224
+ # But caused "Multiple commands produce MapboxCommon/Turf/MapboxCoreMaps"
225
+ # Because @rnmapbox/maps already embeds those transitive dependencies
226
+ #
227
+ # v2.2.9 (Step 2 removed entirely):
228
+ # → No "Multiple commands produce" ✅
229
+ # → But "Missing package product MapboxNavigationCore/UIKit" ❌
230
+ # → Because Pods.xcodeproj is rebuilt by CocoaPods each time, so the
231
+ # package reference injected into pods_project does not persist.
232
+ # Without a reference in user_project (Navio.xcodeproj, which persists),
233
+ # Xcode does not resolve the SPM package and the products are not found.
234
+ #
235
+ # v2.2.10 (this version — package reference only in user_project):
236
+ # → Add ONLY the XCRemoteSwiftPackageReference to user_project ✅
237
+ # → Do NOT add XCSwiftPackageProductDependency to user_target ✅
238
+ # → This registers the package in the Xcode workspace SPM graph so it
239
+ # gets resolved and downloaded, without embedding its frameworks again.
240
+ installer.aggregate_targets.each do |agg|
241
+ user_project = agg.user_project
242
+
243
+ # Add only the package reference — not the product dependencies
244
+ user_pkg = user_project.root_object.package_references.find { |p|
245
+ p.class == pkg_class && p.repositoryURL == url
246
+ }
247
+ unless user_pkg
248
+ user_pkg = user_project.new(pkg_class)
249
+ user_pkg.repositoryURL = url
250
+ user_pkg.requirement = requirement
251
+ user_project.root_object.package_references << user_pkg
252
+ puts "[ExpoMapboxNavigation] Registered mapbox-navigation-ios in #{user_project.path.basename}"
253
+ end
254
+
255
+ user_project.save
256
+ end
226
257
  end
227
258
  `;
228
259