AudioKit 4.11.2 Playgrounds: "No such module AudioKitPlaygrounds"

1.3k views Asked by At

It has been a year since updating so I downloaded AudioKit 4.11.2 yesterday. I built all of the frameworks, including the AudioKit and AudioKitUI xcframeworks.

Then I began playing with the Playgrounds. Right away Xcode tells me the build failed because it can't find the AudioKit frameworks. It appears that the Search Paths that are set in the original project file need tweaking so I set it to "$(inherited)../Frameworks".

Now it builds but still will not run, saying on the import AudioKitPlaygrounds statement that there is No such module AudioKitPlaygrounds.

Odd, because that is the target of the build and it exists in the Derived Data Products folder.

Searching through StackOverflow shows that AudioKit has had similar problems like this in the past but none of the proposed solutions seemed relevant to my situation.

What other tricks are necessary to get the Playgrounds running? Shouldn't it build and run straight out of the box without messing with the project search paths?

My environment is: macOS 10.15.6 MacBookPro Xcode 12.0.1

Successful Build but no such module?

Search Path for Frameworks

Derived Data

4

There are 4 answers

4
megastep On

How did you build the frameworks? The assumption when it comes to the paths in other projects (including Playgrounds) is that they have been built via the build_frameworks.sh and build_xcframework.sh scripts in the Frameworks directory.

The end result should be a set of XCFrameworks in that same Frameworks directory, which is in turn referenced by examples and the playgrounds project.

0
TylerSeppala On

To anyone still experiencing this issue, I just found a really simple solution. I was opening my playground files directly from 'Open Recent'. Problem is, Xcode doesn't automatically look at the parent directory and included files. Just close Xcode and open the AudioKitPlaygrounds.xcodeproj from finder. When you open your playground files from there they should work properly.

0
David Thery On

Also, make sure to:

  • run 'pod install' + automatically converting to swift5 in XCode
  • check "Build Active Scheme" as mentioned by Miguel FOR EACH single playgrounds you want to run.
  • run the playground with the play button in the editor, not the xcode main run button

If you want instead to use AudioKit in another XCode project, only two steps:

  • download AudioKit and AudioKitUI frameworks from here:
  • embed them in General > Frameworks, Libraries, and Embedded content, as shown on the screenshot below.

enter image description here

1
Miguel de Sousa On

I ran through a similar problem with macOS 10.15.7, XCode 12.1 and AudioKit 4.11.2.

I got the same “No such module AudioKitPlaygrounds” message.

The "Build Active Scheme" option was unchecked in my File Inspector >> Playground Settings, so I checked it, rebuild the "Introduction and Hello World" .playground and it worked.

Edit (04/15/2021): David Thery gave a more complete answer in the following answers.