"Singing.ogg"? JUCE Assertion failure in DemoUtilities.h:108

jassert (resourceFile.existsAsFile());

The resource path passed to this function is “singing.ogg”

This only happens when I try to run the AudioPluginHost as a debug exutable.

If I try to run the AudioPluginHost on its own, it crashes and this is in the error details:

Thread 0 Crashed:: JUCE Message Thread  Dispatch queue: com.apple.main-thread
0   com.juce.pluginhost           	0x000000010ddc2178 juce::SamplerSound::SamplerSound(juce::String const&, juce::AudioFormatReader&, juce::BigInteger const&, int, double, double, double) + 120 (juce_Sampler.cpp:37)
1   com.juce.pluginhost           	0x000000010ddc2523 juce::SamplerSound::SamplerSound(juce::String const&, juce::AudioFormatReader&, juce::BigInteger const&, int, double, double, double) + 83 (juce_Sampler.cpp:53)
2   com.juce.pluginhost           	0x000000010dc39b94 AUv3SynthProcessor::loadNewSample(std::__1::unique_ptr<juce::InputStream, std::__1::default_delete<juce::InputStream> >, char const*) + 356 (AUv3SynthPluginDemo.h:428)
3   com.juce.pluginhost           	0x000000010dc3985f AUv3SynthProcessor::AUv3SynthProcessor() + 1791 (AUv3SynthPluginDemo.h:323)

Well, the error is quite self-explaining here :wink:

jassert (resourceFile.existsAsFile());

If you hit this assertion with having resourceFile set to "singing.ogg" you can read it like
“We assert that singing.ogg exist as file to continue the code correctly”. Now if your debugger stops here, this is a sign that the assertion is not true, e.g. in this specific case that singing.ogg does not exist as file. If you don’t have a debugger attached (or if you compile it as release build) there is no chance that the debugger stops here, so code will continue, expecting that resourceFile exists as file and will likely crash at the point where the file access will happen.

So your main question should be: Why does the program think that singing.ogg does not exist as file? A common mistake is to place some file somewhere beneath the executable and then expect that just specifying it as relative path will work, as it will be interpreted as relative to the current working directory which can be anything, especially when working with a GUI app or a plugin. The documentation of the File class states that very explicitly. So you should better specify a full path to the file. To make it portable, File::getSpecialLocation can help you