Failed to demangle superclass with Cocoapods in Xcode 10.2

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:

-all_load linker flag

Hope this helps someone else!