AudioUnits cannot be found, how do I fix this?

I have a consistent problem with an app I am developing and I have no idea what is going on or how to fix it.


The short version is I am unable to instantiate a custom AUv3 I made. Two make matters stranger when I compare this behavior to a Apple's AUv3Host demo application, the AVAudioUnitComponentManager instance in that application is unable to find any of the third-party (non-Apple) AUv3s installed on my iPad , including the custom one I made. This issue persists across restarts of my app. Once it starts the only way I am able to fix either of these problems, is I have to shut my app, and Apple demo app down completely, and then open GarageBand and go through the motions like I am adding a new audio track with an AUv3. Once I get to the page where all the third part AUv3s are displayed, I can close GarageBand, restart debugging my app and the AVAudioUnitComponentManager can find everything in the Apple Demo app (including the custom AUv3 I am using).


Has anyone had a problem like this, and if so how do you fix it to make sure third-party or custom AUv3's are always found?


This is how I instantiating my custom AUv3, but I don't think I am doing anything weird.


  AVAudioUnitMIDIInstrument.instantiate(with: theAudioComponentDescription,
    options: auOptions,
    completionHandler: { avAudioUnit, error in
  guard
  error == nil,
  let theAVAudioUnit = avAudioUnit else {
  os_log(.error,
    log: self.logger,
    "Error instantiating SearSynth AU.")
  return
  }


Thanks stan.

AudioUnits cannot be found, how do I fix this?
 
 
Q