Linker command failed due to Undefined Symbol errors.

Xcode will build and analyze fine using the Debug build configuration but trying to use Analyze or Archive with Release configuration generates 3 errors: Undefined symbol: protocol conformance descriptor, Undefined symbol: type metadata accessor, and Undefined symbol: nominal type descriptor causing the linker to command to fail. The library is included and already linked and a previous version did not have the error so I think it's a code issue but not quite sure what it is or how to fix!

The project/package can be found here: https://github.com/kudit/Device/tree/v2.1.17 (to reproduce, checkout this version and rename appending ".swiftpm" to the folder, then right-click to show package contents, open the Development folder and open the Xcode project there. It's done this way so the package can be imported and edited on iPad Swift Playgrounds)

Answered by kudit in 808902022

Found a workaround/solution: There was a class that I wanted internal, but making it public silenced the compiler warnings in the RELEASE configuration. Hope this helps someone.

Still happening in version 2.2.2 which has been tested by Swift Package Index as free from errors and concurrency issues so I'm now thinking this may be a bug in Xcode...

https://github.com/kudit/Device/tree/v2.2.2

Accepted Answer

Found a workaround/solution: There was a class that I wanted internal, but making it public silenced the compiler warnings in the RELEASE configuration. Hope this helps someone.

Linker command failed due to Undefined Symbol errors.
 
 
Q