Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile for arm64 simulator if the project also uses Swift Package Manager #195

Closed
tikitu opened this issue Apr 24, 2023 · 4 comments

Comments

@tikitu
Copy link

tikitu commented Apr 24, 2023

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:

  1. Add any SPM package whatsoever to the sample.
  2. Import a type from that package
  3. Try to build for a recent iOS simulator, on an M1 Mac.

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):

  • iOS SDK version: 2.25.0
  • OS and version: macOS Monterey 12.6.4
  • Xcode version: 14.2 (not using Rosetta emulation)

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.

@beHaze beHaze added the backlog label Apr 28, 2023
@emilyvon
Copy link

emilyvon commented May 2, 2023

I'm facing the same issue with the following setup:

  • OpenTok iOS SDK 2.25.0
  • macOS Ventura 13.2.1
  • Xcode 14.2

Adding some screenshots for references:

In OpenTok pod setting: EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 for both debug and release:
235587852-592ea372-4a07-4bb3-8002-4b0eb8143df4

And if I commented that line out in the generated pod setting file, I ran into another issue:
235588361-74bb64e1-cbed-4b83-a869-5439ef37acc0

@vona-ben
Copy link

vona-ben commented May 2, 2023

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

@vona-ben
Copy link

vona-ben commented May 2, 2023

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

@jvalli
Copy link
Contributor

jvalli commented May 26, 2023

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:

@jvalli jvalli closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants