Failed to demangle superclass with Cocoapods in Xcode 10.2

别来无恙 提交于 2019-12-05 00:16:28

I have discovered this in the Xcode 10.2 Release Notes, under "Swift Compiler" -> "Known Issues":

Linking against a static Swift library might create a binary with missing type metadata because the object files that define the metadata inside the static archive are mistakenly considered unused. (47598583)

This can manifest as a Swift runtime error with a message such as: “failed to demangle superclass of MyClass from mangled name ‘’”.

Workaround: If you can rebuild the static library, try building it with whole module optimization enabled. Otherwise, add -all_load to the linker flags in the client binary to ensure all object files are linked into it.

And I was able to resolve the issue by adding -all_load to Other Linker Flags of the main Project:

Hope this helps someone else!

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