Recently, I have purchased a M1 Mac mini and have a fairly large project with in house created SPM dependencies. Our dependencies are dynamic frameworks, and currently, they aren't very complex.
Our project has the following settings where:
Build Active Architectures = true for all configurations other than Release
And I've been messing around with the Excluded Architectures option to remove arm64 from simulator builds.
With this being noted, although we have in-house SPM SDKs (non binary deliveries), it would seem our project is flagging up Could not find module 'XXXX' for target 'x8664-apple-ios-simulator'; found: arm64, arm64-ios-simulator where derived data is showing arm64 is being resolved for a standard simulator build (iPhone 12 mini 14.3) via Xcode 12.2 and 12.3. Does anyone know why this is happening and is there a configuration that SPM is not respecting regarding Valid architectures or building for active architectures causing it to evaluate an incorrect arch type. Everything does build correctly when evaluated against Any iOS device (as this does not take x8664 as an arch type) and evaluates correctly on non M1 Macs for the remaining sim arch types.
Edit:
It's fairly easy to repro this situation with the following steps:
Create new Xcode project (UIKit + Swift)
Create Embedded dynamic framework bundle
Create Swift Package (dynamic)
Link Swift Package to Embedded dynamic framework bundle (make sure it’s not embedded as we only want it linked)
Embed dynamic framework bundle to main project
Embed dynamic Swift Package framework to main project
Add flag to “Exclude Architectures” for “Any iOS Simulator SDK” to exclude arm64 architectures (ensuring any existing FAT binaries do not have an arm64 slice running in the simulator).
Build project.
Our project has the following settings where:
Build Active Architectures = true for all configurations other than Release
And I've been messing around with the Excluded Architectures option to remove arm64 from simulator builds.
With this being noted, although we have in-house SPM SDKs (non binary deliveries), it would seem our project is flagging up Could not find module 'XXXX' for target 'x8664-apple-ios-simulator'; found: arm64, arm64-ios-simulator where derived data is showing arm64 is being resolved for a standard simulator build (iPhone 12 mini 14.3) via Xcode 12.2 and 12.3. Does anyone know why this is happening and is there a configuration that SPM is not respecting regarding Valid architectures or building for active architectures causing it to evaluate an incorrect arch type. Everything does build correctly when evaluated against Any iOS device (as this does not take x8664 as an arch type) and evaluates correctly on non M1 Macs for the remaining sim arch types.
Edit:
It's fairly easy to repro this situation with the following steps:
Create new Xcode project (UIKit + Swift)
Create Embedded dynamic framework bundle
Create Swift Package (dynamic)
Link Swift Package to Embedded dynamic framework bundle (make sure it’s not embedded as we only want it linked)
Embed dynamic framework bundle to main project
Embed dynamic Swift Package framework to main project
Add flag to “Exclude Architectures” for “Any iOS Simulator SDK” to exclude arm64 architectures (ensuring any existing FAT binaries do not have an arm64 slice running in the simulator).
Build project.