Importing AudioKit framework gives "'x' is not a member type of 'AudioKit' errors

Viewed 788

I've been trying to add AudioKit to a project in Xcode to no avail - even blank projects created just to import AudioKit into my View Controller are throwing 2711 errors, mostly saying "'x' is not a member type of 'AudioKit', "Initializer does not override a designated initializer from its superclass", and "Method does not override any method from its superclass".

I'm trying to add AudioKit by directly adding the frameworks to the project as recommended by this video https://www.youtube.com/watch?v=iUvWxWvRvo8&feature=youtu.be, adding appropriate Framework Search Paths and Linker Flags to the build target.

I've read that these errors can be thrown by types and frameworks having the same name, and AudioKit contains a header file called "AudioKit.h". Changing the name of this throughout AudioKit didn't help, however, and the import AudioKit line started giving me a 'No Such Module (changed name)' error rather than the usual 'Failed to load AudioKit'. Changing the name of the framework as a whole had the same effect.

Is this an issue I can solve or something specific to AudioKit? I'm running Catalina 10.15.3. and have been able to install other frameworks via CocoaPods, but that didn't work for AudioKit. It's like pulling teeth here, I'd be grateful for input from anyone with the same issue.

These are the errors I'm being shown:

enter image description here

EDIT: Airdropping my project file onto a different Mac and compiling worked absolutely fine with Audiokit, so I've got no idea what the issue is.

2 Answers

Hi @Jowan and future readers, I had the same issue and found that it's best to stick with cocoapods, here's a working version for the latest ios and swift 5.2:

platform :ios, '11.0'

target 'AKRecorder' do
  use_frameworks!

  pod 'AudioKit', '~> 4.9.5'

end

I've reported the issue here if you want to take a look in other steps I took (How to include Audiokit 4 in a new project xcode 11 and swift 5.1?)

Good luck!

This issue also happened to me a week ago (my post: AudioKit Playground Builds fail) and the reason why it was brining up these errors, was because I didn't have the newest version of Xcode and AudioKit 4.9.5 only seems to work with the newest version of Xcode. To fix this error, you either need to update your Xcode, or download older version of AudioKit (what I did). To download the older version of AudioKit you can go to this website https://github.com/audiokit/AudioKit/releases and open the older AudioKit version assets, or you can to download it through cocoapods, you will need to write (pod 'AudioKit', '4.9.4') or a different version, in the pod file.

Related