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

'Unsupported Swift architecture' error when compiling for simulator #978

Open
AlexIzh opened this issue May 14, 2024 · 3 comments
Open

'Unsupported Swift architecture' error when compiling for simulator #978

AlexIzh opened this issue May 14, 2024 · 3 comments

Comments

@AlexIzh
Copy link

AlexIzh commented May 14, 2024

Describe the bug
I have build the framework by using scripts/buildPrebidMobile.sh script and now trying to integrate XCPrebidMobile.xcframework into current iOS application. When doing that I'm getting Unsupported Swift architecture for PrebidMobile-Swift.h file when trying to run an app in iOS simulator. It works fine for real device though.

To Reproduce
Steps to reproduce the behavior:

  1. Build the framework by using scripts/buildPrebidMobile.sh
  2. Add XCPrebidMobile.xcframework to iOS project
  3. Build for iOS simulator
  4. See error

Expected behavior
The framework could be integrated and used as for real devices so and for simulators for testing purposes.

Desktop (please complete the following information):

  • OS: MacOS Version 14.4 (23E214
  • Xcode: 15.4
  • Sim Version: 17.4

Additional context
I'm running it on M1 laptop, if I change scripts/buildPrebidMobile.sh to -arch arm64 for iphonesimulator then it works fine. But it's not going to work if a few developers work on the same project with different machines or if CI is running on Intel chip

@jsligh
Copy link
Collaborator

jsligh commented Jun 3, 2024

@AlexIzh this seems to be a xCode related issue and not a Prebid one.

@jsligh jsligh closed this as completed Jun 3, 2024
@YuriyVelichkoPI
Copy link
Contributor

I wouldn't close this issue. From time to time, we face requests that buildPrebidMobile.sh doesn't work in some circumstances. Since it is part of the repository, we should fix or delete it. I vote for fixing, especially considering that we are going to support SPM, and this script will actually build the framework for future publishing.

@jsligh jsligh reopened this Jun 3, 2024
@dcaunt
Copy link

dcaunt commented Jul 19, 2024

I'm not an expert with XCFrameworks, but I had the same issue and figured out how to build:

At present, the script builds two directories within XCPrebidMobile.xcframework, ios-arm64 and ios-x86_64-simulator. By removing the explicit arch argument passed to xcodebuild:

it will produce a folder ios-arm64_x86_64-simulator, and the Info.plist lists both arm64 and x86_64 under SupportedArchitectures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

4 participants