Could not find module for target 'arm64-apple-macos'; found: x86_64, x86_64-apple-macos

I have an XCode Workspace that builds a product as a universal binary for Intel and Apple Silicon.

On an Intel-based machine, I am attempting to import a Swift Package dependency by accessing a private git repository.

When I attempt to import my dependency into my code and build, I'm getting the following error:

Could not find module '<swift package name>' for target 'arm64-apple-macos'; found: x86_64, x86_64-apple-macos

The project has Standard Architectures set for the ARCHS build setting and ONLY_ACTIVE_ARCH = NO. When I switch ONLY_ACTIVE_ARCH = YES, it builds fine.

Is there a way to instruct the compiler to build the swift package dependency as universal and resolve this issue?

When I switch ONLY_ACTIVE_ARCH = YES, it builds fine.

I hit this myself because I always want to build all architectures [1]. The only workaround I found was to revert to using Xcode’s default active architecture setup. I ended up filing a bug about this (r. 78708476). It was dup’d to another bug that’s still under investigation.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Because I work on small projects and the benefit of finding architecture-specific bugs outweighs the cost of the extra build time.

Could not find module for target 'arm64-apple-macos'; found: x86_64, x86_64-apple-macos
 
 
Q