When I create a new XCode project that references (as opposed to CocoaPods, etc) one of the AudioKit frameworks, XCode does not autocomplete AudioKit declarations and explicitly declaring an AudioKit object (such as AKMIDISampler) results in a build error: 'AKMIDISampler' is unavailable: cannot find Swift declaration for this class.
Typically the problem lies in correctly inputting the framework search paths in XCode. However, even though I put in a relative path to the framework for both my target and my project, I still get the same results.
It's likely that this is an issue with all 3rd party frameworks, but I am asking it here in reference to AudioKit as I have seen this question come up before in the AudioKit Support group on Google.
What is the best practice in setting up a new project to use AudioKit so that AudioKit is recognized and autocomplete work?
I've worked out the solution and am posting it here for future reference.
Here is a step by step to get setup with AudioKit.
Two things to note:
Steps:
Now you can import AudioKit and declarations should resolve.
Step 3 above is typically the point most get incorrect. Many expect SRCROOT to be implied and expect that just putting in a relative path is sufficient, but it is not. SRCROOT must be specified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With