Playground can't find symbols in swift private frameworks

I have a set of playgrounds that I'm using with a with a private (Swift) framework that is hosted, alongside my app targets, inside a workspace. The playground imports the private framework, and the editor is at least aware of the framework's code.


However, when I attempt to execute the playground, I get no output except the following error in the console:


Playground execution failed: error: Couldn't lookup symbols:

__TF.......

__TW.......

__TZ.......


The mangled-symbol lines are obvioiusly truncated to protect the innocent, but these are all symbols that are in the framework and are referenced in the playground.


I've verified that:

  • The framework is in the same workspace as my playground
  • It's being used by at least one app target (it's actually being used by two separate app targets).
  • The framework is being imported in the playground (interestingly, when the playground first loads, there's a "Cannot find framework ..." tooltip error, but that goes away after a couple of seconds.
  • The editor is aware of all symbols, and I can control-click through to any of them.


While it's been a while since I used the playground, it previously worked with XCode6. I'll appreciate any tips.

Replies

I had something similar going on and the solution made me feel pretty dumb: I hadn't built the framework that I was using in the playground. Now I thought I did, or that the other targets I built would implicitly build the framework for use in the playground, but that wasn't the case. When I explicitly selected the framework target and built it, my problems went away. Hopefully this helps you.

Thanks, but no dice—still seeing the same issues on XCode 7.1 GM.

This really sounds like the playground's not getting built for some reason. Perhaps it's not getting built for the simulator?


If you can, please file a bug report and attach the entire workspace.

Same error here ("Couldn't lookup symbols"). Followed all of Apple's guidelines—pre-compiled framework, active scheme, common workspace—no luck. Anyone actually found a definitive solution?


btw, the framework and playground are OS X only, at this point, not iOS.

Having this problem in Xcode 12 using a playground that used to work in Xcode 11 and 10. Trying to import a class in a framework from the same workspace. Playground compiles fine but then we get "error: Couldn't lookup symbols". Why can't Apple make Playgrounds "just work"? How about giving us a way to explicitly link certain frameworks to the playground so it never has this problem...?
Post not yet marked as solved Up vote reply of O_G Down vote reply of O_G