Juce 7 cannot create filebrowser in AUV3 on iOS

Hi, trying to launch a filebrowser seems to launch the browser (i.e. ui disabled) but there’s no actual browser visible. Just pulled 6.1.6 and the code works fine.

thx

1 Like

Hi,
I’m afraid I’m also being able to reproduce this. same code worked for me and seems broken with latest develop.

This is how my FileChooser is constructed.

fileChooser ("Import Preset", juce::File::getSpecialLocation (juce::File::userDocumentsDirectory), "*" + juce::String (kPresetExtension), Utils::usePlatformDialog()
#if JUCE_IOS
,
false,
getTopLevelComponent() // AUv3 Sandbox requirement
#endif
)

As leehu, also for me the UI ‘freeze’ on GarageBand.

Exact same code works in Standalone and also worked with JUCE 6.0.x builds.

I’ve bisected this,
That’s the faulty commit -

Note: Standalone still works, only AUv3 is broken.

Additional Observations:

  • I’ve also tried with OpenGL renderer (though I didn’t sanity check myself) and had the same behavior

  • Even without JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS this behaviour is reproduced. So it’s not the CAMetalLayer specifically?

I’ve found it,
If anyone else can confirm.

On juce_ios_UIVIewComponentPeer.mm

change this (private decl to public).

class UIViewComponentPeer  : public ComponentPeer,
                             private UIViewPeerControllerReceiver

to this

class UIViewComponentPeer  : public ComponentPeer,
                             public UIViewPeerControllerReceiver
3 Likes

I got the same issue, even after I revert back to juce 6.0.4, my iPad is on the latest iOS 15.6, hope this can be fixed soon.

I’ll try check this out today

1 Like

Although the file browser dialog on iOS standalone works, but after I selected a supported audio file, it won’t get loaded, no sound on iOS, but all of my functions work under Mac and PC, I already used URL to use a file on iOS, it’s really weird.

Btw this is my code incase I did it wrong, I use browseForFileToOpen() to open the file chooser dialog window, it can open dialog in Mac/PC/iOS standalone, but will freeze in iOS AUv3.

std::unique_ptr<juce::FileChooser> chooser;
chooser = std::make_unique<juce::FileChooser> (
        "Choose a file",
        juce::File(),
        audioProcessor.getFormatManager().getWildcardForAllFormats(), true, false,
#if JUCE_IOS
        this
#else
        getTopLevelComponent()
#endif
        );

if (chooser->browseForFileToOpen())
{
auto fileURL = chooser->getURLResult();
audioProcessor.loadFile(fileURL);
}

This line is suspicious. Try other wild cards. iOS is very picky.

Yet would be nice if JUCE team could push the fix for post metal commit changes

Ok, this is trying to get all the supported audio file type, this line works in iOS standalone pretty well, will grey out those not supported files.

I really don’t know another way to do this, any suggestions?

@ttg works - nice find!

I tried this method, changing UIViewPeerControllerReceiver from private to public, then file browser under iOS AUv3 is ok, but iOS standalone freezes this time :rofl:

Update: both standalone and AUv3 will work fine, if UIViewPeerControllerReceiver is public.

@reuk hi - can we get some team exposure to this please. thx

@reuk, @t0m - can someone please take a look at this please. thx

2 Likes

+1

Thank you for reporting.

5 Likes

There is one more issue with FileChooser::Native in AUv3. The plugin crashes if the editor is closed while FileChooser is active. Destructor is called from ModalComponentManager::handleAsyncUpdate, but the object is freed already. Anyone can recreate it?

Oh god, this is exactly what I’m experiencing now, did you find the solution?

Hi, we both found this issue, any suggestion for dealing with this?

Hi. Not really, it just sits there and I dont have enough time/experience to hack native iOS wrappers. Besides the fact that we still use workarounds to make the chooser popover work in AUv3.