# \[Bug\] KnownPluginList::scanAndAddDragAndDroppedFiles() fails for AU plugin

**URL:** <https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340>\
**Category:** General JUCE discussion\
**Created:** [April 2, 2021, 8:34pm UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340 "2021-04-02T20:34:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [April 2, 2021, 8:34pm UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/1 "2021-04-02T20:34:38Z")

</div>

Trying to load an AU plugin from the command line with the following code:

```auto
int main (int argc, char* argv[])
{
    juce::MessageManager::getInstance();

    juce::ArgumentList args {argc, argv};

    const auto file = args[0].resolveAsExistingFile();
    juce::AudioPluginFormatManager formatManager;
    formatManager.addDefaultFormats();

    juce::KnownPluginList knownPluginList;
    juce::OwnedArray<juce::PluginDescription> typesFound;
    knownPluginList.scanAndAddDragAndDroppedFiles (formatManager, { file.getFullPathName() }, typesFound);

    DBG (typesFound.size());

    juce::MessageManager::deleteInstance();
    return 0;
}

```

For a valid AU plugin (that loads fine in Logic, passes auval, etc.) passed as the first argument, typesFound has a size of 0.

This same code works fine for VST3.

Stepping through the code, it seems the issue may come from here:

> <https://github.com/juce-framework/JUCE/blob/df132fd6df7e0759bf6b8a5d26a97a9d1965885c/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm#L2676>

The `auComponent` value is `nullptr` so the callback is being called with the `nullptr` argument meaning the instance of the AU plugin isn’t created.

Tested with the `GainPlugin` demo with the same result of 0 types found.

This bug is breaking CI with pluginval, as explained here:

> <https://github.com/Tracktion/pluginval/issues/39>
>
> Hi there, 
> 
> We have been using pluginval in our Jenkins pipeline to validate t…he VST3 and AU directly from local build path. The following commands are called:
> 
> \`\`\`
> ./pluginval.app/Contents/MacOS/pluginval -W --strictness-level 10 --validate "build/plugin/MyPlugin.vs3" --output-dir "./logs" --validate-in-process
> 
> ./pluginval.app/Contents/MacOS/pluginval -W --strictness-level 10 --validate "build/plugin/MyPlugin.component" --output-dir "./logs" --validate-in-process
> \`\`\`
> 
> Recently we updated to Juce6 from 5. And the AU part return \`No Types Found\` error on scanning but the VST3 part worked fine. I can verify that the local path to the AU plugin exists and works as intended. 
> 
> Upon researching issue \[38 \](https://github.com/Tracktion/pluginval/issues/38), I tried running \`killall -9 AudioComponentRegistrar\`. But nothing changed. Does the AU now have to be put in Library/Audio/Plugin instead of local path for pluginval to work?
> 
> Any suggestion please?

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [April 3, 2021, 8:55pm UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/2 "2021-04-03T20:55:27Z")

</div>

If I remember correctly (it’s been a while) the AU plugin must be installed into the correct location (i.e. /Library/Audio/Plug-Ins/Components or similar) it’s nothing to do with JUCE it’s just how has to be for the plugins to be discovered.

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [April 4, 2021, 10:11am UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/3 "2021-04-04T10:11:06Z")

</div>

Even with the gain plugin example installed to ~/Library/Audio/Plug-Ins/Components/ I can’t get it to load in the audio plugin host… starting to think it might just be a permissions thing.

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [April 4, 2021, 10:24am UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/4 "2021-04-04T10:24:12Z")

</div>

Seems that any plugin built with latest JUCE isn’t working… tried downloading the trial of FabFilter’s Saturn 2 and that worked fine, so did one of my own plugins built with an older version of JUCE 6.

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [April 4, 2021, 11:33am UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/5 "2021-04-04T11:33:34Z")

</div>

Ah I wonder if it’s being made to run out of process and that’s somehow causing the problem. I take it you’re also running `sudo killall -9 AudioComponentRegistrar` before? does `auval` work OK?

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [April 4, 2021, 3:15pm UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/6 "2021-04-04T15:15:49Z")

</div>

> [@anthony-nicholls](#):
>
> sudo killall -9 AudioComponentRegistrar

Seems to have done the trick…

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [April 4, 2021, 5:40pm UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/7 "2021-04-04T17:40:35Z")

</div>

Yeah, that’s a horrible one, it seemed to take a while for anyone to figure that out. You can also do a restart but obviously no good on CI.

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [April 4, 2021, 9:23pm UTC](https://forum.juce.com/t/bug-knownpluginlist-scanandadddraganddroppedfiles-fails-for-au-plugin/45340/8 "2021-04-04T21:23:56Z")

</div>

Sadly still can’t get it to work on my azure pipeline… already wasted the majority of my bank holiday weekend on this so tbh I think I’m just gonna give up and only test vst3 for now.
