Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

iOS Simulator does not work on Apple Silicon #558

Open
chrisballinger opened this issue Nov 24, 2020 · 35 comments
Open

iOS Simulator does not work on Apple Silicon #558

chrisballinger opened this issue Nov 24, 2020 · 35 comments

Comments

@chrisballinger
Copy link

chrisballinger commented Nov 24, 2020

The current podspec excludes ARM architectures for iphonesimulator, which makes it impossible to use the Mapbox SDK in the iOS Simulator on Apple Silicon devices without using Rosetta. The only way forward here is to start vendoring an xcframework instead of a framework. Swift Package Manager and recent versions of CocoaPods support vendoring xcframeworks, but Carthage has been lagging behind (although there are some promising PRs in the pipeline).

Related issues: #171 #346 #117 #546

edit: consider MapLibre instead for Apple Silicon support: https://github.com/maplibre/maplibre-gl-native#ios

@MetaImi
Copy link

MetaImi commented Dec 3, 2020

The offered workaround (exclude arm64 from simulator) let Mapbox runs on Apple Silicon, but it kills the simulator touch interface. That means you can not swipe properly, just drag. On the map, it means you can not position it properly, because the sim recognise it as a really fast swipe.

@babeone
Copy link

babeone commented Jan 4, 2021

@MetaImi where i can find this workaround? thank you

@MetaImi
Copy link

MetaImi commented Jan 10, 2021

@babeone To build for simulator on M1 Mac, you have to exclude the arm64 architecture. Open your target, then build settings -> Excluded Architectures -> Debug -> Add new entry for Any iOS Simulator SDK, and add value: arm64

@PH9
Copy link

PH9 commented Jan 11, 2021

@babeone To build for simulator on M1 Mac, you have to exclude the arm64 architecture. Open your target, then build settings -> Excluded Architectures -> Debug -> Add new entry for Any iOS Simulator SDK, and add value: arm64

Does not work

  • maxOS Big Sur 11.1 (20C69)
  • MacBook Pro (13-inch, M1, 2020)
  • Xcode 12.3 (12C33)
  • CocoaPods: 1.10.1
  • Mapbox-iOS-SDK 5.9.0
PhaseScriptExecution [CP]\ Copy\ dSYMs /Users/w/iOS/DerivedData/ApplicationName/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/Script-18AB8786486F17095F3AFA36E1A9D377.sh (in target 'Mapbox-iOS-SDK' from project 'Pods')
    cd /Users/w/iOS/Pods
    /bin/sh -c /Users/w/iOS/DerivedData/ApplicationName/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/Script-18AB8786486F17095F3AFA36E1A9D377.sh

rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/w/iOS/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM" "/Users/w/iOS/DerivedData/ApplicationName/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/DerivedSources"
building file list ... done
created directory /Users/w/iOS/DerivedData/ApplicationName/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/DerivedSources
Mapbox.framework.dSYM/
Mapbox.framework.dSYM/Contents/
Mapbox.framework.dSYM/Contents/Info.plist
Mapbox.framework.dSYM/Contents/Resources/
Mapbox.framework.dSYM/Contents/Resources/DWARF/
Mapbox.framework.dSYM/Contents/Resources/DWARF/Mapbox
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/rsync.c(244) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code

@mehlkelm
Copy link

mehlkelm commented Mar 24, 2021

I have the same problem.

@babeone To build for simulator on M1 Mac, you have to exclude the arm64 architecture. Open your target, then build settings -> Excluded Architectures -> Debug -> Add new entry for Any iOS Simulator SDK, and add value: arm64

This workaround does not work for me either.

I get the same error when trying to install onto an actual device, btw.

@noway
Copy link

noway commented Apr 1, 2021

This is pretty critical for us in order to switch our dev environment to M1 machines. Any timeline on this?

@noway
Copy link

noway commented Apr 1, 2021

The exclude arch arm64 for Any iOS Simulator SDK workaround doesn't work for me either and produces the output similar to @PH9 albeit a bit different:

PhaseScriptExecution [CP]\ Copy\ dSYMs /Users/ilia/Library/Developer/Xcode/DerivedData/mytours-alkhisngqcdaawctkmkthubdcdda/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/Script-6F8F3D4AF39B823F0E706CF80F0401E0.sh
    cd /Users/ilia/mytours/mytours-rn/ios/Pods
    /bin/sh -c /Users/ilia/Library/Developer/Xcode/DerivedData/mytours-alkhisngqcdaawctkmkthubdcdda/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/Script-6F8F3D4AF39B823F0E706CF80F0401E0.sh

rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/ilia/mytours/mytours-rn/ios/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM" "/Users/ilia/Library/Developer/Xcode/DerivedData/mytours-alkhisngqcdaawctkmkthubdcdda/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/DerivedSources"
building file list ... done
created directory /Users/ilia/Library/Developer/Xcode/DerivedData/mytours-alkhisngqcdaawctkmkthubdcdda/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Mapbox-iOS-SDK.build/DerivedSources
Mapbox.framework.dSYM/
Mapbox.framework.dSYM/Contents/
Mapbox.framework.dSYM/Contents/Info.plist
Mapbox.framework.dSYM/Contents/Resources/
Mapbox.framework.dSYM/Contents/Resources/DWARF/
Mapbox.framework.dSYM/Contents/Resources/DWARF/Mapbox

sent 649517438 bytes  received 88 bytes  259807010.40 bytes/sec
total size is 649437857  speedup is 1.00
/Users/ilia/mytours/mytours-rn/ios/Pods/Target Support Files/Mapbox-iOS-SDK/Mapbox-iOS-SDK-copy-dsyms.sh: line 21: ARCHS[@]: unbound variable
Command /bin/sh failed with exit code 1

We are using Mapbox-iOS-SDK as part of @react-native-mapbox-gl/maps.

@sooxt98
Copy link

sooxt98 commented Apr 20, 2021

Coming from flutter, try add Excluded Architectures "armv7" to your App target profile
image

Or try go to your app and make xcode run in Rosetta
image

@noway
Copy link

noway commented May 23, 2021

Coming from flutter, try add Excluded Architectures "armv7" to your App target profile
image

Or try go to your app and make xcode run in Rosetta
image

This doesn't work for me.

@aduuub
Copy link

aduuub commented Aug 10, 2021

If we can get access to the compiled simulator framework we can create an xcframework using the following

xcrun xcodebuild -create-xcframework
-framework /path/to/ios.framework
-framework /path/to/sim.framework
-output combined.xcframework

@noway
Copy link

noway commented Aug 10, 2021

@aduuub
How to get access to the compiled simulator framework?

@aduuub
Copy link

aduuub commented Aug 10, 2021

I can't find access to it, but if Mapbox provides it we could create an xcframework

@noway
Copy link

noway commented Aug 10, 2021

I actually found a way to build mapbox SDK v6 for Simulator on Apple Silicon. It's to use MapLibre which offers an SPM distribution. More details here: https://github.com/react-native-mapbox-gl/maps/issues/1472#issuecomment-889805609

@pitazzo
Copy link

pitazzo commented Sep 13, 2021

I'm very interested into getting this working as well!

EDIT
Hey @noway, could you explain how did you manage to fix it following that comment? I added following code to my Podfile, but I'm still getting same error.

  $RNMBGL_Use_SPM = {
    url: "https://github.com/maplibre/maplibre-gl-native-distribution",
    requirement: {
        kind: "exactVersion",
        version: "5.11.0"
    },
    product_name: "Mapbox"
  }

@michaelfransen
Copy link

Excluding an architecture doesn't seem like a valid solution. I am running into an issue with trying to use a different framework via SPM which builds using the active architecture. This causes a mismatch of framework architectures.

@aduuub
Copy link

aduuub commented Sep 14, 2021

If it was packaged using the new standard of distributing binaries as an xcframework, it would contain all of the architectures required and not need specific frameworks stripped at compile time.

It would also allow it to be distributed as a closed source Swift package which would be awesome

@noway
Copy link

noway commented Sep 24, 2021

I'm very interested into getting this working as well!

EDIT
Hey @noway, could you explain how did you manage to fix it following that comment? I added following code to my Podfile, but I'm still getting same error.

  $RNMBGL_Use_SPM = {
    url: "https://github.com/maplibre/maplibre-gl-native-distribution",
    requirement: {
        kind: "exactVersion",
        version: "5.11.0"
    },
    product_name: "Mapbox"
  }

sorry, i don't quire remember, i lost the feature branch where i was trying it out.

@noway
Copy link

noway commented Sep 24, 2021

But i think it was to do with pinning the exact version of the package.

@CooperWolfe
Copy link

I'd be interested to see this working too, the workaround is not cutting it for me either.

@minkhantlu
Copy link

Following up, I am having the same problem here, found a way to solve this ?

@MetaImi
Copy link

MetaImi commented Nov 1, 2021

No, I will just start the migration to V10. That is supporting apple silicon. I don't think mapbox will invest anything to old library. :(

@tomhut
Copy link

tomhut commented Nov 23, 2021

It would be good to know if there are any plans to resolve this. We plan on migrating to Apple Silicon for development and CI soon and this is our only blocker.

@noway
Copy link

noway commented Nov 23, 2021

@tomhut

It would be good to know if there are any plans to resolve this. We plan on migrating to Apple Silicon for development and CI soon and this is our only blocker.

Ok, it's not ideal but here's what I do:

I have a script which rips out mapbox gl for Simulator builds and replaces all the calls with stubs. I use React Native, so a bit easier to do with javascript, but essentially any Simulator builds on Apple Silicon have stubbed out mapbox.

@designedbyclu
Copy link

Any updates?

@csaper
Copy link

csaper commented Dec 3, 2021

+1

@macdrevx @1ec5 Would you guys mind updating us on this please? There are a handful of other related open issues that could be closed with a resolution –
#617
#487
#171

Thanks!

@awcchungster
Copy link

This is still an issue after 18 months... this seems pretty ridiculous. Is there even a single person from Mapbo on this issue?

@user425846
Copy link

This is still not fixed and absolutely ridiculous. I spent so many hours integrating the sdk and looking for a solution for this problem. This is just completely embarassing for everyone involved.

@chrisballinger
Copy link
Author

I'm guessing that the new proprietary Mapbox SDK probably supports Apple Silicon at this point, but it looks like the open source code here is no longer maintained.

The MapLibre fork of the old open source code has Apple Silicon support: https://github.com/maplibre/maplibre-gl-native#ios

@csaper
Copy link

csaper commented Aug 17, 2022

@chrisballinger FYI - the Mapbox legacy SDK is still officially Mapbox-supported until April 4, 2023 per their note here. Therefore, I'd suggest keeping this issue open as it actually has not been resolved.

@georgbachmann
Copy link

Yes... would be great if somebody from Mapbox could join the conversation here?
@ZiZasaurus are you involved in the old SDK as well?

@ZiZasaurus
Copy link
Contributor

At the moment, nothing has changed and there is still the need to manually exclude arm64 when building v6 for the simulator on M1 Mac.

@georgbachmann
Copy link

@ZiZasaurus thank you for your response. At least for me the excluding of arm64 does not work. I am still getting compile errors, no matter how often I clean-build. And as you can see by the number of people here, it's not working for others as well.

To be honest, I don't really know what the problem ist after all. Isn't it just compiling again with the latest toolset and including all slices? I really don't know... but if so, that would seem like a task that could be done quite fast? And it would make a lot of people here quite happy.

As @csaper mentioned three posts up, you officially support the old version until April 4th, 2023 and it also states that this includes "compatibility and bug fixes". Is't that a compatibility fix? We are monthly paying customers and it would be important for us to have a working test-environment (the simulator) again without having to use Rosetta Mode.

I know that updating to V10 could solve the problem. But in my personal opinion, V10 is just not ready yet. It has so many little bugs, that using our map with V10 just does not feel good. The map just does not behave like a map (Google or Apple or even this legacy version for comparison ) should. My main complaints would be about scrolling in the map. Just not good. I already filed a few bug-reports for V10 as well.

So for the time being, you would make so many of us here happy if you could PLEASE provide us with a little update that will support Apple Silicon.

@chrisballinger
Copy link
Author

@ZiZasaurus @georgbachmann I would suggest switching to the MapLibre fork. Worked great for us, and even supports offline bundled MBTiles which the official SDK refused to support.

@skienzl
Copy link

skienzl commented Oct 4, 2022

@ZiZasaurus Any news on this issue or the timeline to provide support for Apple Silicon? Also the solution to exclude arm64 isn't working on my side.

@georgbachmann
Copy link

georgbachmann commented Nov 17, 2022

@ZiZasaurus are you guys looking into this or will this not be fixed any more?
Not being able to run an app in the simulator sucks... :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests