Missing required module 'CNIOAtomics' when I copy CLI target product into macOS app bundle

I work on an Xcode project that has three targets:

  • macOS app
  • CLI
  • shared framework (mostly shared types and constants)

macOS app and CLI have NIO as a dependency.

When I build and run targets in the default configuration, everything works. However, I plan to bundle the CLI into the main app bundle so users can install/symlink it to make it available in their PATH. When I add the "Copy Files" build phase and select the CLI product, the macOS app doesn't build with the error "missing required module 'CNIOAtomics'" that originates in the CLI.

How to configure the build considering the requirements?

This question is probably more of an Xcode question, and would be better served on the Apple Developer Forums.

I don't think NIO being a dependency of these apps should be relevant here.

1 Like

Ref: Missing required module ‘CNIOAtomi… | Apple Developer Forums

Bummer. I forgot to add CLI target to the "Target Dependencies" build phase.