本文介绍了导入Swift Package Manager依赖项时出现“无此模块”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Xcode 11 Beta4。
我正在使用CocoaPods,并且想将我的依赖之一与Swift Package Manager一起用作静态库而不是框架。
在使用Xcode 11创建的新项目中,可以成功导入依赖项,但是在我现有的CocoaPods工作区中则不能。

I'm running Xcode 11 Beta 4.I'm using CocoaPods, and wanted to use one of my dependencies with Swift Package Manager as a static library instead of as a framework.On a fresh project created with Xcode 11, the dependency can be imported successfully, but on my existing CocoaPods workspace, it does not.

我认为这很可能相关,但我也在Xcode中收到此链接警告:

I think it's likely related, but I'm also getting this link warning in Xcode:

directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/App-axanznliwntexmdfdskitsxlfypz/Build/Products/Release-iphoneos

I在发出警告后去查看目录是否存在,并且确实存在。
除了存在CocoaPods之外,我找不到新创建的项目与旧项目之间的任何有意义的区别。

I went to see if the directory exists after the warning is emitted, and it does.I could not find any meaningful difference between the newly-created project and my old one, other than the existence of CocoaPods.

不胜感激任何指针。 / p>

Would appreciate any pointers.

推荐答案

事实证明,Swift软件包管理器隐式依赖于项目的配置名称。我在现场/质量检查中使用了它们,而不是发布/调试,然后将它们改回来解决了这个问题。很奇怪,但是我希望它可以为您节省一些麻烦,亲爱的读者。

It turned out that Swift Package Manager implicitly depends on the project's Configuration names. I had them at live/qa instead of Release/Debug, and changing them back resolved the issue. Very odd, but I hope it saves you some trouble dear reader.

这篇关于导入Swift Package Manager依赖项时出现“无此模块”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 21:07
查看更多