4

I have an iOS app that has been working fine with AudioKit's iOS build. I wanted to try porting to macOS w Catalyst by dropping in AudioKit.xcframework. Here is what I did

  1. compile AudioKit-4.9.5 from source to generate AudioKit.xcframework (I had previously been using a locally compiled AudioKit iOS framework from the same source release with no issues on the non-Catalyst version)
  2. in the "General" tab,
    • checked Mac as a deployment target
    • removed the old AudioKit iOS framework
    • added AudioKit.xcframework
  3. in "Build Settings" tab,
    • change "Framework Search Paths" from the parent directory of the AudioKit iOS framework to the parent directory of AudioKit.xcframework
  4. in the "Build Phases" tab,
    • AudioKit.xcframework appears in "Link Binary with Libraries"
    • AudioKit.xcframework appears in "Embed Frameworks"

I receive the following errors,

AudioKit.xcframework compilation errors

Currently using Xcode 11.4.1.

inhuman
  • 145
  • 6

2 Answers2

2

Answering my own question here since this issue seems to be an artifact of the AudioKit module containing a AudioKit class. Renaming AudioKit class to something else fixes the issue although I'd discourage folks from doing this and instead waiting for a future AudioKit release that does this.

inhuman
  • 145
  • 6
1

I had the exact same problem. I ended up editing the x86_64-apple-ios-macabi.swiftinterface file and correct the interface by hand.

I only had to prefix AudioKit. in from of the identifier unresolved. It looks more like a bug with the XCFramework build configuration / the swiftinterface generator.

I also run into a crash at runtime when using AKSampler(). For some reason the compiler do not understand that .init() do not exist and that it should use the AKSampler(masterVolume: 1.0, pitchBend: 0.0, ... filterEnvelopeVelocityScaling: 0.0) prototype. Calling by hand with the default values fix it.

Edit: You do not need to explicitly call the long initializer, you simply have to remove the line:


  @objc override dynamic public init()

from the @objc open class AKSampler : AKPolyphonicNode, AKComponent { section.


To summarize: Edit the x86_64-apple-ios-macabi.swiftinterface in the XCFramework/ AudioKit.output and AudioKit.midi.client in place of the unresolved identifier.

If you use AKSampler, remove the line:

  @objc override dynamic public init()

from the @objc open class AKSampler : AKPolyphonicNode, AKComponent { section.

Jeremy Cochoy
  • 2,480
  • 2
  • 24
  • 39