How to fix Swift Build error: no such module "ModuleName", when the package is included in dependencies?

How to fix Swift Build error: no such module "ModuleName", when the package is included in dependencies?

我用包管理器添加了来自 github 的 CodeScanner 包,但是在构建编译器时仍然出现错误:

No such module 'CodeScanner'

我重新安装了软件包,尝试了全新构建、关闭并重新打开 xcode,但这些操作均无效。有什么建议吗?

转到您的构建方案,然后在 run 选项卡 -> info 选项卡中将您的构建配置切换为 Development。这对我有用!我一直在寻找这个几天,直到我在 apple dev 论坛

中找到 this last comment