我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
当前回答
对我来说,我修复了它替换任何波浪号(~)字符在我的自定义路径$(HOME)。自定义路径位于Xcode首选项的位置选项卡下。
其他回答
大多数其他答案都是针对CocoaPods或迦太基用户的。如果你不使用这些,但只是想在你的项目中删除一个框架并链接它,它将需要在框架搜索路径中。
系统框架已经在搜索路径(即/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/ sdk/ iPhoneOS${version}.sdk/ system /Library/ frameworks /)。如果您试图使用的文件不在此路径中,则需要将它们的路径添加到Build Settings中的FRAMEWORK_SEARCH_PATHS中。
为什么XCode不知道在哪里找到它,即使你左边面板上的框架在右边面板的标识和类型中列出了一个位置和完整的路径?那我不知道。
有时豆荚分解,然后豆荚安装也帮助我。
几分钟前我找到了解决我案子的办法。 该项目是一个使用cocos2d框架的objective c项目。 没有一个预览解决方案有效。
只是我删除VALID_ARCH行自定义在构建设置和项目开始构建模拟器。
Another possible cause in XCode 10 can be the Supported Platforms sometimes gets changed to macOS and the Valid Architectures gets changed to i386 x86_64 for the Pods Projects. Assuming the project is for iOS, then select the Pods Project and change the Supported Platforms to iOS and the Valid Architectures to arm64 arm64e armv7 armv7s, You could do each of the Targets, however that takes longer if you have more than one Pod. Also the Swift version of frameworks in written Swift sometimes gets set to the wrong version.
我在使用Cocoapods和Swift时也遇到了同样的问题。我没有注意到Podfile中的以下行:
# Uncomment this line if you're using Swift
# use_frameworks!
所以,我所要做的就是把它改成:
# Uncomment this line if you're using Swift
use_frameworks!
...啊,它起作用了:)