AudioKit / Cookbook

Canonical Examples for Using the AudioKit Framework
MIT License
605 stars 97 forks source link

Missing required module 'CAudioKitEX' in Previews #154

Open mahal opened 2 months ago

mahal commented 2 months ago

macOS Version(s) Used to Build

macOS 14.4.1 Sonomna

Xcode Version(s)

Xcode 15.2

Description

The Controls demo doesn't show properly when holding an iPhone in portrait mode, see image below. The knobs are too small and the keyboard has grotesque dimensions. It looks fine in landscape and on iPad.

In order to fix it within ControlsView.swift I tried adding following code. Neither version works but that gives stranges error that I can't fix. Tried it on several recipies: ControlsView, TableRecipeView, ...

struct ControlsView_Previews: PreviewProvider {
    static var previews: some View {
        ControlsView()
    }
}
#Preview {
    ControlsView()
}

<unknown>:0: error: missing required module 'CAudioKitEX'

Steps to reproduce

  1. Fork CookBook
  2. Compile and deploy on iPhone
  3. Start app, navigate to "Additional Packages > Controls"
  4. Hold iPhone upside (portrait)
  5. Knobs are too small, Keyboard dimensions are grotesque
  6. Try to fix it with Xcode preview
  7. Absurd errors in Xcode that won't go away
NickCulbertson commented 2 months ago

tl;dr Swift Previews are not working in the Cookbook. Throws error missing required module 'CAudioKitEX' even though AudioKitEX appears to be included. Nothing is broken at the moment, but the error shows up when you add a preview:

#Preview {
    ControlsView()
}

Yeah, I'm seeing this issue too and not sure how to fix it. That may be why Swift Previews were removed at some point from the Cookbook. The Cookbook adds packages to CookbookCommon rather than to the project. I can see where AudioKitEX is added so I'm not sure why previews can't find it as it compiles. Maybe @aure will know something.