mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Catalyst Support + M1

Open parrots opened this issue 4 years ago • 4 comments

There's a long thread (https://github.com/mapbox/mapbox-gl-native-ios/issues/117) on the legacy v6 Mapbox SDK about getting Catalyst support, and it seems that while this new SDK supports metal so Catalyst is possible, something is misconfigured with the shipped framework preventing it from working. Not sure if this is an M1 specific issue as I do not have an Intel Mac to also test with, but the build error leads me to guess that.

Environment

  • Xcode version: 13.0 RC
  • Maps SDK Version: 10 RC 8

Observed behavior and steps to reproduce

  • Download RC 8, open the Examples app xcproj (not workspace)
  • Add RC 8 as a dependency to the project via SPM
  • Open the build settings for the Examples target, and on the General tab check the "Mac" support checkbox
  • (Make sure your signing settings are properly configured here, might get errors about signing profile)
  • Set your destination to "My Mac" at the top of Xcode, then try to build and run

Expected behavior

Should build and run locally

Observed behavior

Does not build. If you're on an M1 Mac building, you'll get the following error:

ld: warning: ignoring file /Users/parrots/Library/Developer/Xcode/DerivedData/Examples-anjbxfhnfyknmlfwaklruslpjpmc/Build/Products/Debug-maccatalyst/MapboxCoreMaps.framework/MapboxCoreMaps, building for Mac Catalyst-arm64 but attempting to link with file built for Mac Catalyst-x86_64
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_MBMCameraBoundsOptions", referenced from:
      objc-class-ref in MapboxMaps.o
  "_OBJC_CLASS_$_MBMCameraOptions", referenced from:
      objc-class-ref in MapboxMaps.o
  "_OBJC_CLASS_$_MBMCoordinateBounds", referenced from:
      objc-class-ref in RestrictCoordinateBoundsExample.o
      objc-class-ref in MapboxMaps.o
...

If you try to build and run using the "My Mac (Rosetta)" you get an odd code signing error (although obviously we shouldn't need to use Rosetta).

parrots avatar Sep 15 '21 21:09 parrots

Thanks for reporting this issue. While we do support building for the iOS platform with an M1 Mac / Apple Silicon, we do not support Catalyst at this time.

knov avatar Oct 04 '21 12:10 knov

Out of the box on an intel macbook pro building an app for catalyst with macbox as a dependecy gives only the two following errors.

Screen Shot 2021-12-30 at 11 24 41 AM

This happens in a generated file, Forcing the types to Turf.Polygon allows it to build. Then, when trying to run on a mac locally the remaining issue is related to codesigning:

Screen Shot 2021-12-30 at 11 45 47 AM

mpiannucci avatar Dec 30 '21 16:12 mpiannucci

Any updates on this ?

michael-mansour avatar Jul 21 '22 06:07 michael-mansour

Is there a workaround for this issue? After installing the SDK via SPM, my app won't build for Mac at all. If I want to build a MacCatalyst version of my app without any Mapbox-related feature today, would it be possible to exclude the SDK as a dependency?

dandyweng avatar Jul 24 '22 14:07 dandyweng

Catalyst build was fixed in https://github.com/mapbox/mapbox-maps-ios/commit/51f2527bda4e20792a6ff108114e3aa093ceae65

OdNairy avatar Jan 15 '24 08:01 OdNairy