AudioKit 4.11.2 Playgrounds: "No such module AudioKitPlaygrounds"
Asked Answered
S

4

5

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

Sequestered answered 6/10, 2020 at 0:31 Comment(0)
C
6

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.

Carpel answered 5/11, 2020 at 19:33 Comment(1)
man you are a savour, i wasted 20 minutes, thank you so much!!!Vingtetun
F
1

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

Feliks answered 22/3, 2021 at 15:31 Comment(0)
M
0

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.

Monofilament answered 6/10, 2020 at 23:52 Comment(4)
Just to be sure I was not hallucinating, I downloaded a fresh v4.11.2 release from github and ran ./build_frameworks.sh from the Frameworks directory. The build succeeded and the xcframeworks are now in the Frameworks folder. The macOS example project for FlangerAndChorus builds and runs as expected with no changes to any project settings. Then I opened the Playgrounds project and picked "Introduction and Hello World". The build is successful but the playground will not run. The error given is "No such module 'AudioKitPlaygrounds'". This is the same behavior as my first post.Sequestered
I am experiencing the same thing. Creating a new playground and copy pasting code from one of the existing ones works. Removing and re-adding the included playgrounds does not work. Something seems to be wrong inside the bundled playground packages. macOS 10.15.4 xcode 12.0Raymer
I am able to reproduce and indeed this seems broken in Xcode 12. However I have had some luck making that error go away simply by checking the "Build Active Scheme" settings box for the playground. Still having trouble with the playground actually starting though...Monofilament
It took me a while to find the "Build Active Scheme" checkbox. What a pain, it needs to be set for each playground in the project. But, with that set I am now seeing lots of other errors, such as this one in the Formant Filter: error: Formant Filter.xcplaygroundpage:23:58: error: argument 'value' must precede argument 'format' addView(AKSlider(property: "x", format: "%0.3f", value: filter.x) { sliderValue in error: Formant Filter.xcplaygroundpage:23:72: error: value of type 'AKFormantFilter' has no member 'x'Sequestered
T
0

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.

Trigonal answered 10/5, 2021 at 20:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.