首页 ld: library not found for -lswiftContacts
文章
取消

ld: library not found for -lswiftContacts

今天一个 OC 的 demo 工程 pod 里面包含了一个 swift 第三方, 然后 build 时候遇到下面的错误:

ld: library not found for -lswiftSwiftOnoneSupport for architecture x86_64

一般看到指令集问题, 第一反应就是换真机试试. 不过有点不可思议, pod 的都是源码, 第一次遇到这样的错误. 好吧, 那换真机试试?? 然后, ld: library not found for -lswiftContacts for architecture arm64

Baidu 无果只好 Google, 然后找到了下面这句话.

You need to add at least one Swift file to the target you are trying to build! So just add a Swift file to the project which wants to use your Swift framework and it works

原文地址

大概意思就是, 在你 build 的工程里面要至少需要包含一个 swift 文件.

难道只有 target 下面有 swift 文件时候, build target 时候, 才会引入 swift 相关的支持库?

好吧, 创建了一个 swift 文件到 target 下面之后, 问题果然解决了.

本文由作者按照 CC BY 4.0 进行授权