We are developing a bunch of
xcframeworks, that are using some other
xcframeworks, that are distributed via
After switching to xcode 14 build system, generated headers for our frameworks started looking like that:
#if 0 #elif defined(__arm64__) && __arm64__ // Generated by Apple Swift version 5.7 (swiftlang-22.214.171.124.4 clang-1400.0.29.50) ... bridging for arm64 #else #error unsupported Swift architecture #endif
For that part of developers and consumers of our framework, which uses Intel macs, it leads to errors, while trying to build for simulator.
I've created sample project that, reproduces issue and also includes script for creating xcframework, which is similar to the one we use - create-xcframework.sh.
I found out that the presence of pods affects this. If the framework does not use them, then there is no such error. Code fro creating
xcframework is the same and can be found in branch no-pods-no-issues
xcframeworks I've followed instructions from Creating a multiplatform binary framework bundle.
I've tried to resolve error following TN3117: Resolving architecture build errors on Apple silicon.
I've found some common issues on stackoverflow and apple forum, but there is no working solution in any of them.
- When compiling with Xcode14 I get Error unsupported Swift architecture. How to solve this?
- Xcode 14.2 build fail
- Error unsupported Swift architecture.
How to force generated swift header to contain define for
x86_64 alongside with
Which setting leads to that kind of generation?
How should pods project be changed to avoid that side effects?