The dependency is a pure Swift package (SwiftyXMLParser), and I'm bringing it into my app with a package dependency from the git repository URL.
My app is configured to build standard architectures to run natively on both Apple Silicon and Intel.
The build fails because it looks like the package manager only provides the active architecture, not a universal library, when the latter is configured. It happens when I set "Build Active Architecture Only" to NO (if it's set to YES it succeeds, but then the app won't run on the other architecture).
In particular, if I build on my M1 mini, the error is
Code Block Could not find module 'SwiftyXMLParser' for target 'x86_64-apple-macos'; found: arm64, arm64-apple-macos
If I build on my x86 MBP, same failure but the error is opposite (no arm64, found: x86_64).
So clearly SPM+Xcode can provide either architecture - is it possible for it to provide a universal lib? Or do I need to download the source of the package and build it through a more manual process?
In the app build settings under Architecture, get rid of $(ARCHS_STANDARD) (click the minus to delete it) and add both architectures as explicit values, arm64 and x86_64. Apparently there's an issue with that default setting not really conveying that both architectures are needed when the package dependency is built, completely regardless of the "active architecture" setting.
Everything works great with this change, I was able to build and notarize the app on M1 and verify it now also runs on x86.