Failed to instantiate AU

I’m working on an AUv3 iOS plugin. My engine uses JUCE, but my UI / plugin code doesn’t, so this is more a general question than a JUCE question.

Sometimes when debugging in GarageBand I get:

2017-12-14 13:45:35.995730-0800 MobileGarageBand[24115:2440953] [ops] Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.foo.InstrumentDemoApp.InstrumentDemoAppExtension" UserInfo={NSDebugDescription=connection to service named com.foo.InstrumentDemoApp.InstrumentDemoAppExtension}
2017-12-14 13:45:35.998800-0800 MobileGarageBand[24115:2440943] Failed to instantiate AU.
Description: Couldn’t communicate with a helper application.
Reason: (null)

There error appears before any of my code is called. Any idea what could be going on?

Might be helpful to someone else but I had this all the time and not just sometimes and eventually found a solution. Remove the plugin from the “Plug-ins & EQ” list. Then start debugging GarageBand. And then adding the plugin again will cause Xcode to connect for debugging.