0

I've recently tried to include Audiokit 4 in a new project using Xcode 11 and swift 5.1, but I get the error message No such module Audiokit, the closest I get to Audiokit is CoreAudiokit by following the instructions in (https://github.com/audiokit/AudioKit/blob/master/Frameworks/README.md).

Here're the steps I followed:

1) Create new single view project in xcode11

2) Project settings, General tab, Frameworks/Libraries added item Audiokit.framework

3) In the ContentView.swift file: import Audiokit or import AudioKit

enter image description here

I've doubled checked the release notes and it clearly states support for Xcode 11 (https://github.com/audiokit/AudioKit/releases)

Finally, tried to compile it myself but the same issue as stated above, module not found.

git clone https://github.com/audiokit/AudioKit.git

./build_frameworks.sh

enter image description here

I can see the AudioKit framework under frameworks:

enter image description here

Other linker flags is also set as instructed:

enter image description here

Updated to Xcode 11.4 (latest), same issue.

Also tested moving the audiokit dir, same issue, nothing seems to make it work, so not sure what other people been doing considering the comments in github which seems they use it with Xcode 11.4...

enter image description here

punkbit
  • 7,347
  • 10
  • 55
  • 89

2 Answers2

1

Try changing the "Embed & Sign" setting for the frameworks to "Do Not Embed". The built frameworks are static and while they need to be linked in your project, they should not be embedded since they can't be dynamically loaded.

megastep
  • 1,246
  • 12
  • 13
1

After hours trying things, I found a solution! Just have in mind before proceeding that I've updated to the latest (time of writing) Xcode 11.4 and swift 5.2.

I've moved the file from Frameworks / AudioKit.framework to the project:

enter image description here

And then, while selecting the AudioKit.framework in the show/hide inspector, I change the location to relative to project and target to the current project name as follows (the name of the project changed to test in comparison with the earlier or original post version):

enter image description here

Obs: I've also tested by modifying the build settings, removed all subdirectories to exclude in recursive searches extensions; and add the relative path where the audiokit.framework can be found to the framework search paths. The autocomplete works, but I still get the error No such module 'AudioKit'. So, this far the only option that works is the comment before.

--------------------- a few days later ------------------------

Just had a quick look at this and decided to update the report here.

Unfortunately, the fix above removes the "not found" error but the application crashes. Using cocoapods to install audiokit also seems to not cause the "module not found error".

-------------------- weeks later --------------------

Use cocoapods to include audio into your project as last stated and as follow:

platform :ios, '11.0'

target 'AKRecorder' do
  use_frameworks!

  pod 'AudioKit', '~> 4.9.5'

end
punkbit
  • 7,347
  • 10
  • 55
  • 89
  • I followed the instructions just like you and it's not working for me either in a fresh XCode 11.5 project. – SouthernYankee65 Jun 21 '20 at 17:00
  • Have you tried the cocoapods way? I've actually upgraded to 11.5 today, but haven't start a new Audiokit project with. The ongoing project runs though – punkbit Jun 21 '20 at 22:32
  • I tried using CocoaPods for it, but didn't have any success there either. I reached out to MP3Gain Express author to see if there was a way I could implement his software as a library, but he only recommended making a CLI call to the ACCGain program. I just want to normalize my music in memory to a specified level without modifying the actual file before playback. That pyDub library is slick as snot and easy to use. Wish there was something like that for Swift. – SouthernYankee65 Jun 23 '20 at 17:38
  • The instructions I posted should work but that is prior to XCode 11.5; I haven't tested adding AudioKit to 11.5 yet. You may instead build from source-code, but that didn't work for me, I had to use cocoapods. Another option you may want to use instead is FFMPEG and run the normalization feature or change the gain (https://github.com/sunlubo/SwiftFFmpeg); The library is a wrapper for FFMPEG so check the original docs to find out what to do. I think this is the best for you. – punkbit Jun 23 '20 at 19:13