Hi everyone,
I’m working on a JUCE-based audio player, and I’m facing an issue on macOS. When I click the Load button, the file dialog appears, but it doesn’t allow me to select and load files into the playlist/library. This works fine on Windows but fails on macOS.
What I’ve Observed:
- The FileChooser opens but doesn’t allow selecting files for loading.
- No error messages, but files aren’t added to the playlist.
- Works perfectly on Windows with the same code.
juce::FileChooser chooser(“Select an audio file…”,
juce::File(),
“.wav;.mp3;*.ogg”,
true); // Force native macOS dialog
chooser.launchAsync(juce::FileBrowserComponent::openMode | juce::FileBrowserComponent::canSelectFiles,
[this](const juce::FileChooser& fc)
{
auto chosenFile = fc.getResult();
DBG("Selected file: " + chosenFile.getFullPathName()); // Debugging log
if (chosenFile.existsAsFile())
{
player->loadURL(juce::URL{ chosenFile });
waveformDisplay.loadURL(juce::URL{ chosenFile });
}
else
{
DBG(“
File selection failed!”); // File doesn’t exist
}
});
Questions:
- Could this be a JUCE issue with file permissions on macOS?
- Do I need additional entitlements or
Info.plistmodifications? - Is there a known workaround to force FileChooser to allow selecting files?
Any help would be appreciated. Thanks!
