`Undefined symbol: _OBJC_CLASS_$_DDLog` when trying to run unit tests with Simulator target

On Xcode 13.4.1, when specifically trying to run unit tests, I get an error Undefined symbol: _OBJC_CLASS_$_DDLog. After clicking on it in the Issue navigator, a longer error message says

Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_DDLog", referenced from:

      objc-class-ref in

How might I fix this? I tried running both Xcode and the Simulator in Rosetta, but I get the same error message but for x86.

I tried running both Xcode and the Simulator in Rosetta

Do not run Xcode or the simulator under Rosetta. That’s an unsupported configuration and, while it might yield an short-term results, it will definitely cause you problems in the long term.

This error suggests that you’ve failed to link with a specific library, one that contains the DDLog class. I recommend that you investigate where that class is expected to be coming from and add it to the libraries list for the target that’s missing it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

`Undefined symbol: _OBJC_CLASS_$_DDLog` when trying to run unit tests with Simulator target
 
 
Q