Closed tikitu closed 1 year ago
I'm facing the same issue with the following setup:
Adding some screenshots for references:
In OpenTok pod setting: EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
for both debug and release:
And if I commented that line out in the generated pod setting file, I ran into another issue:
Hello @emilyvon @tikitu , Since 2.24.2 release, we have M1 / arm chipset support. To build on arm chipset based machines, users have to use OTXCFramewok
instead of Opentok
pod (version >= 2.24.2)
Example:
target 'Basic-Video-Chat' do
pod 'OTXCFramework', OpenTokSDKVersion
end
instead off
target 'Basic-Video-Chat' do
pod 'Opentok', OpenTokSDKVersion
end
Note: We are currently working on an iOS SDK Swift Package Manager, which will be available soon. I will keep you updated on the progress in this thread
The issue is because you are trying to use old fat framework on M1 machine(arm64). The old fat framework version cannot have unique build configuration to work on both arm64 & x86_64 simulators, so we were agree that old fat framework version will be distributed with "EXCLUDED_ARCHS[sdk=iphonesimulator*]": "arm64" configuration to be able to use it on Simulator Intel machines(x86_64) by default. If the build configuration is removed it works on Simulator M1 but not on Simulator Intel.
So you can use new XCFramework version available through:
OTXCFramework
Describe the bug The setting
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
from the OpenTok pod is incompatible with SPM packages: if a project includes both the OpenTok pod and any SPM package at all, it will fail to build for arm64 simulators (including simulators for recent iOS versions on M1 Macs).To Reproduce Steps to reproduce the behavior:
I made an example at https://github.com/tikitu/opentok-ios-sdk-samples-swift/tree/spm-and-m1 importing the SwiftArgumentParser package, just to show my working.
Expected behavior The project should compile. Instead it fails, with the error message
Could not find module 'ArgumentParser' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator
.Device (please compete the following information):
Additional context This is more urgent now that Xcode 14.3 has shipped, as this Xcode version removes support for Rosetta emulation: developers on an M1 Mac must stay with Xcode 14.2 if their project includes both OpenTok and any SPM packages.
There's a related issue asking for SPM support (#130) -- while that would be great, the more significant point for our team is that we cannot use SPM for other packages if we're including the OpenTok pod.