How to resolve this error: Could not find module 'InternalPackage' for target 'x86_64-apple-ios-simulator'; found arm64-apple-ios-simulator

I'm trying to integrate a new version of the Kofax iOS SDK into an app with several internal Swift Packages. To make the Kofax SDK work when building on Apple Silicon Machines, the documentation says to add 'arm64' to the excluded architectures for 'Any iOS Simulator SDK'. This generates the following build error for a SiriKit Extension target:

Could not find module 'InternalPackage' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/uu9j1a0/Library/Developer/Xcode/DerivedData/AppName-fnblaczxrbpssvfefysiuarpbybg/Build/Products/Debug-iphonesimulator/InternalPackage.swiftmodule

Here is what I've tried so far:

  1. Although this apple developer forum post is for MacOS, for the overall App and the SiriKit Extension, in Build Settings > Architectures, I tried explicitly replacing $(StandardArchitectures) with arm64 and x86_64.
  2. Ensured that Build Settings > Build Active Architecture Only was set to Yes for debug builds, according to this post.
  3. Changed "Always embed swift standard libraries" to yes for the extensions throwing the error and the app as a whole. Neither worked. Reference.
  4. Set Build Settings > Validate Workspace to yes. Reference.
  5. Tried updating the supported versions for iOS and watchOS for the InternalPackage.

Unfortunately, the error remains. Thanks in advance for any suggestions.

Packages don't allow customization of the architectures to build for and will always build with default settings for "Build Active Architecture Only", which has the consequence that when building in debug mode, you'll only get an arm64 build of any packages.

1 Like

Did you managed to solve this ?

I am having same error when tried moving some classes from one module to spm by creating a spm module

fixed by changing the build active architecture only to YES in development.