Closed Unknoob closed 3 years ago
I also ran into this same issue today where my built frameworks weren't working on the simulator. Discovered the same thing that you did, the lipo command to merge the simulator and on-device frameworks failed and I ended up with a framework that only supported on-device. This fix looks good to me (although I'm just a stranger on the internet who has no actual ruby experience, not a maintainer of this project).
Here's the current output of file
on the framework if I only generate the simulator build:
kjohnson@sudowoodo ~/src/framework-generator/ios/build/Release-iphonesimulator/React-RCTBlob/RCTBlob.framework $ file RCTBlob
RCTBlob: Mach-O universal binary with 3 architectures: [i386:Mach-O dynamically linked shared library i386] [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64]
RCTBlob (for architecture i386): Mach-O dynamically linked shared library i386
RCTBlob (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
RCTBlob (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
It might be better to use EXCLUDED_ARCHS=arm64
to be more futureproof. Right now the simulator builds include i386
, x86_64
, and arm64
and I think we only need to remove arm64
. On the other hand, we probably aren't losing much by dropping i386
support.
This relates to https://github.com/CocoaPods/Rome/issues/65
When using Rome on XCode 12, we get an error when merging the Simulator and Device frameworks.
That happens because when compiling for a Simulator on XCode 12, we end up with both
x86_64
andarm64
binaries(thanks to the new arm Macs). To fix the problem I added a build setting to build onlyx86_64
architecture when building for the Simulator, that way we can merge it normally after both are compiled.I still need help with 2 things.
arm64
binary built for a device work normally in thearm64
simulator in new macs?arm64
slice to run it on a Device? And would it cause problems with thedsym
files?The fix worked for me and may help some other people having this same error, but I'm not sure if I'm breaking the Simulator support on arm Macs, so any help would be appreciated.