UIKit warning after updating to Xcode 16.3 / iOS 18.4

Hi,
Apologies if this has been mentioned before – I couldn’t find anything that matches this exactly.
I’m using UIKit to show a native context menu (copy/paste, etc.) in a plugin. It works fine, but since updating to Xcode 16.3 and iOS 18.4, I immediately get the following warning when running the standalone app on iPad – even before any user interaction:

CLIENT OF UIKIT REQUIRES UPDATE: This process does not adopt UIScene lifecycle. This will become an assert in a future version.

Is this a known issue (in JUCE 8.0.7)? And is there a fix or workaround planned?
Thanks in advance!

Ah, there is a new topic that is related to my question:

@reuk – will this commit also fix the issue that I mentioned above, i.e. silence the warning in the Xcode debug window and updating Juce for upcoming iOS versions?

Well, maybe I should provide some details.
I have a little bit of Objective-C code in a .mm file. That does not seem to be responsible for it. I tried without any iOS native code, there is no difference regarding the warning.
To reproduce the issue, it is enough only to import UIKit:
#import <UIKit/UIKit.h>
I did not want to make experiments before the release of my plugin, but now I looked at the Commit 70a2dd7 on GitHub. I replaced the 3 files in modules/juce_gui_basics/native in my installed version of JUCE 8.0.8. But I guess, this is not the way, just replacing these files, because this resulted in some more errors.
At the moment it is not urgent, the app passed the review in App Store. But I am a little bit concerned about the future.
If someone is interested, this is the link to the App Store:

and some more information:

You’re right, all files need to come from the same JUCE commit. The easiest way to accomplish this is to clone the JUCE repository using git, and then to check out a specific branch (e.g. develop) or tag. This wil also make it easier to update your JUCE version in the future, as you can just check out a new tag, or update the branch. After switching to a new JUCE version, it’s important to remember to rebuild the Projucer using the project files in the JUCE repo, and then resave your project.

This is a valuable information, thank you very much! I will try that and report back (in a few days, I hope).

I did it now – cloned the develop branch and rebuilt Projucer, then built my app.
The previous warning is replaced now by this:

Info.plist contained no UIScene configuration dictionary (looking for configuration named “Default Configuration”)

A side effect is also, that a NativeMessageBox is not shown.
… juce::NativeMessageBox::showMessageBoxAsync (juce::AlertWindow::NoIcon, „Text“ … )
It should appear immediately when launching the standalone app. The rest is still working, what UIKit is expected to do (context menu in standalone and plugin).

I can repro this, and I’ve got a small fix on the way. You’ll need to rebuild the Projucer and resave the project again once the fix has been published.

The native dialogs in the DialogsDemo of the DemoRunner appear correctly for me, so my best guess is that you could be displaying the message box before any components have been added to the screen. Does your app trigger any assertions when run?

  • Where are you calling showMessageBoxAsync? Are you waiting until your main app window has been shown onscreen before attempting to call this function?
  • Are you passing the associatedComponent argument to showMesageBoxAsync? If not, does passing your main app window fix the issue?

Great! I will try again when the fix is out.
The function is called before any components have been added to the screen. It is the first thing that happens in the editor:

CallAppAudioProcessorEditor::CallAppAudioProcessorEditor (CallAppAudioProcessor& p)
    : AudioProcessorEditor (&p), audioProcessor (p)
{
    if (juce::JUCEApplicationBase::isStandaloneApp()) { showAlertWindow(); }
// ...
}

and then

void CallAppAudioProcessorEditor::showAlertWindow() {
    juce::NativeMessageBox::showMessageBoxAsync (juce::AlertWindow::NoIcon,
        "URL Beamer", juce::CharPointer_UTF8
        ("... text") );
}

The dialog works in the original build with JUCE, master branch (official version).

Now I can also answer the remaining questions:

Does your app trigger any assertions when run?

No

Are you passing the associatedComponent argument to showMesageBoxAsync?

I modified the function now by adding a line for the argument (this) – I hope, this is correct:

void CallAppAudioProcessorEditor::showAlertWindow() {
    juce::NativeMessageBox::showMessageBoxAsync (juce::AlertWindow::NoIcon,
        "URL Beamer", juce::CharPointer_UTF8 ("... text"),
        this  // associatedComponent: this = main editor window
	);
}

But this does not fix the issue. Looking forward to your update.

We’ve pushed some fixes that should address these issues:

Please try out these changes and let us know if you’re still seeing issues.

Perfect, this fixed the issue completely!
No more warning, and the message box shows up again as expected.
Thank you very much!