It gives errors when using Swift Static library with Objective-C project

自古美人都是妖i 提交于 2019-11-29 05:51:49

I've got the same error on my demo project when added first Swift file in my pod compiled as static library. For me solution was simple - just added empty Swift file to my demo project which was previously in Objective-C only. This solved all linker errors.

An update to Alex's answer:

In my case it was a React-Native project after adding a Swift Pods library. Maybe just the step 2 can work:

  1. Adding a new Swift file and a Brigde header:

1) File -> New -> File

2) Select Swift File

3) Confirm Create Bridging Header

  1. Go to Build Settings and set Always Embed Swift Standard Libraries to YES

This answer worked for me: Add $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) to the library search paths.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!