mapbox / mapbox-annotation-extension

Framework extensions that can be used with the Mapbox Maps SDK for iOS.
ISC License
11 stars 19 forks source link

Demo application builds for device but fails to build for iOS Simulator on MacBook Pro M1 #77

Open ctsrc opened 2 years ago

ctsrc commented 2 years ago

Hi, I cloned the mapbox-annotation-extension repository and built the annotationapp demo in Xcode on my MacBook Pro M1 for running on a physical device and that works; the "annotationapp" demo application builds and runs as it should.

Unfortunately, when I instead try to run the demo application in iOS Simulator in Xcode the same machine, I get a build time error:

ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/erikn/src/mapbox-annotation-extension/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Mapbox' for architecture arm64

Critically, we are having the same issue with an app that we are creating where we are using mapbox-annotation-extension, in that our app cannot be built for running in iOS Simulator on MacBook Pro M1 because of the error with MapboxAnnotationExtension. And that is why I decided to see if the demo application would run in the simulator.

I have Googled the issue extensively and tried a bunch of things, none of which helps, and I believe that there is something, which I don't quite understand what exactly, that needs to be fixed about the MapboxAnnotationExtension so that apps that use it, including the "annotationapp" demo application, are able to build for and run in iOS Simulator on MacBook Pro M1 computers.

Hope you guys have a chance to look into this as it is causing quite a bit of trouble not being able to run applications that use this extension in the iOS Simulator on MacBook Pro M1 computers.

DevboiDesigns commented 2 years ago

Currently experiencing a very similar thing on the simulator, runs fine on a phone.

Screen Shot 2022-04-05 at 2 29 36 PM

I found that if I step over this entire method every time that it returns nil (first few), and then allow it to run the first time it successfully returns not nil it will successfully compile on the simulator. Decent workaround

DevboiDesigns commented 2 years ago

After doing the above steps, it continues to compile in the Simulator without having to repeat above workaround, if using the same phone version.

ghost commented 8 months ago

I have this issue as well. coming from a project using map_gl which uses this extension. https://github.com/flutter-mapbox-gl/maps/issues/1403