I now have an M1 Mac and an Intel Mac. I have an XCFramework that targets the iOS simulator and devices. My XCFramework works fine but I'd like to be able to run my app (which uses the XCFramework) on the iOS simulator on both my Macs (m1 & intel).
Now my M1 Mac complains about the x86_64 architecture when I try to run it on the simulator. So I rebuilt the XCFramework (recompiling the simulator version on the M1 Mac).
I'm compiling the source code from Terminal (building OpenSSL). There is no .xcarchive here. Anyway now the app runs on the simulator on the M1 Mac but on the Intel Mac it won't build (basically the same problem in reverse).
So... I made three versions of the library now (for iOS devices, iOS simulator on m1 Mac, and for the iOS simulator on Intel Macs). When I try to make an XCFramework to wrap all three static libraries I get the following error:
Both "ios-x86_64-simulator" and "ios-arm64-simulator" represent two equivalent library definitions.
I found another thread where the accepted answer was to lipo the x86_64 and arm simulators together, then build the xcframework. I've seen posts from Apple engineers that say using lipo is not supported (reference: https://developer.apple.com/forums/thread/709812?answerId=719667022#719667022 )
So where am I going wrong? I try to make the xcframework like so:
xcodebuild -create-xcframework
-library build/sim/openssl-1.1.1q/libcrypto.a -headers build/sim/openssl-1.1.1q/crypto
-library build/phones/openssl-1.1.1q/libcrypto.a -headers build/phones/openssl-1.1.1q/crypto
-library build/intelsim/openssl-1.1.1q/libcrypto.a -headers build/intelsim/openssl-1.1.1q/crypto
-output build/Crypto.xcframework