我正在构建一个 Swift 库,并且正在将其托管在 GitHub 上 https://github.com/Napalm-Framework/Napalm.
一切都很顺利,直到我添加蓝牙套件 https://github.com/rhummelmose/BluetoothKit到项目。然后我收到 Apple Mach-O 链接器错误:
ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/Developer/Library/Frameworks'
ld: /Users/calebklevetertest/Library/Developer/Xcode/DerivedData/Napalm-dblvhbjdwovurocsvzrzaxzkjjyw/Build/Products/Debug-iphonesimulator/Napalm.framework/Napalm compiled with older version of Swift language (2.0) than previous files (3.0) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
从阅读错误来看,问题似乎源于我使用 Swift 3,但我不知道如何修复它。
当我添加它时,我确实将 BluetoothKit 转换为 Swift 3。
有一个类使用BluetoothKit,它被称为NPFBluetooth
.
需要注意的几件事是 1) 即使该类是公共的,编译器也会给出“无法解析的标识符”的错误,2) 该类不会在自动完成中显示,3) 所有其他类都工作正常。
我在迁移到 swift3 时遇到了错误。事实证明,Xcode 保留了构建框架的副本,并且迁移到 swift3 显然并不是重建这些框架的提示(即使在发现它是使用 swift2 构建的之后......不,让我们抛出一个模糊的错误......)
解决办法是删除“派生数据”文件夹的内容。 https://stackoverflow.com/questions/38016143/how-to-delete-derived-data-in-xcode-8
适用于安装了 Carthage 和 cocoapods 的框架......
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)