The compiler is not passed - Use Pods used Swift and Objective-C mixed

# Pods use iOS development using Swift and mixed Objective-C - The compiler is not passed -ld: symbol (s) not found for architecture arm64

The basic problem is described in import Pods management in Objective-C Swift problems during
the project needs to show reports, and third-party (Charts) using Swift to write, and I used in the project is written in Objective, which issues involving mixed, although it's mixed very mature, but still will not pay attention to the details, then there is a problem! Today, it is a problem when using Pods to import third-party libraries written in Swift

Issues show - Objective-C project uses Pods (Carthage should also appear) Import Problems occur when a third-party library Swift

ld: warning: Could not find auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find auto-linked library 'swiftFoundation'
ld: warning: Could not find auto-linked library 'swiftMetal'
ld: warning: Could not find auto-linked library 'swiftDarwin'
ld: warning: Could not find auto-linked library 'swiftUIKit'
ld: warning: Could not find auto-linked library 'swiftObjectiveC'
ld: warning: Could not find auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find auto-linked library 'swiftDispatch'
ld: warning: Could not find auto-linked library 'swiftCoreImage'
ld: warning: Could not find auto-linked library 'swiftQuartzCore'
ld: warning: Could not find auto-linked library 'swiftCore'
ld: warning: Could not find auto-linked library 'swiftSwiftOnoneSupport'
省略。。。。
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reason encounter problems

一般人在Objective-C项目和Swift混编时,会创建桥接文件:项目名-Bridging-Header.h .
在Objective-C项目中新建Swift文件时会自动提示是否创建桥接文件,点击蓝色按钮同意就行了.
而出现这个问题的原因是,桥接文件创建成功之后我把我创建的Swift文件给删除了(因为个人认为用不到),如是就提示上面的警告,并且编译不通过。

Solution

创建桥接完成时如果项目中没有Swift文件时,请创建-PS:Pods中的Swift不算
如果没有Swift文件时请创建一个,空文件就行

Guess you like

Origin www.cnblogs.com/Lanht/p/11671113.html