Xcode error on M1 Mac: Could not find module … for target 'x86_64-apple-macos'

Hi!

I need a clue how to solve this issue. I can't build a universal command line app on my new MacBook Pro. I use Swift with some Swift packages and get the error

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

Where do I have to look in Xcode (v 13.1) to get universal packages?

Answered by GreatOm in 697294022

I could solve this issue. As stated at https://forums.swift.org/t/xcode-12-2-spm-swift-nio-fails-to-build-for-apple-silicon-arm64/42197/22

I had the same issue & realized I was building for "My Mac", and not "Any Mac".. that fixed it & built the packages for both. (Top left of the center portion of the Xcode main screen.. where you pick your scheme)

So building for "Any Mac (Apple Silicon, Intel)" works.

Accepted Answer

I could solve this issue. As stated at https://forums.swift.org/t/xcode-12-2-spm-swift-nio-fails-to-build-for-apple-silicon-arm64/42197/22

I had the same issue & realized I was building for "My Mac", and not "Any Mac".. that fixed it & built the packages for both. (Top left of the center portion of the Xcode main screen.. where you pick your scheme)

So building for "Any Mac (Apple Silicon, Intel)" works.

It is still no good solution because building for "Any Mac" does prevent a debug run. I need to switch back to "My Mac". I would prefer a solution wich works for both scenarios…

I have the same issue building my app with exteranl SDKs imported via SPM.. I can't find a solution. Any idea?

Xcode error on M1 Mac: Could not find module … for target 'x86_64-apple-macos'
 
 
Q