`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.

Replies

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"

  • Thanks Quinn. "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." It looks like the specific library is a CocoaPods one, do you know how I would add this to the "libraries list" in the unit test target?

  • Solution which worked for me is. My project is in Objective-c and i selected the .m file (which is giving error) and from File Inspector i checked the target. it works!

Add a Comment