"UI unresponsiveness" warning on @main

I'm seeing a runtime warning in Xcode 14 Beta 5 that says "This method should not be called on the main thread as it may lead to UI unresponsiveness."

This is happening on the @main entry point of my app. See below:

The warning shown gives me no insight into what's actually going wrong. I think it may be due to some Core Location code that runs when the app first opens, but is there a way for me to get some more insight into what's causing this?

Or is this possibly an Xcode 14/iOS 16 bug, and this is not an issue to worry about? I'm not getting any warnings on Xcode 13/iOS 15.

Answered by DTS Engineer in 730526022

The purple warning is calling attention to a runtime issue that may impact the performance of your app. In general, you should resolve these issues when they are in your code, by moving the code off the main thread. When you receive one of these runtime performance issues, you can expand the backtrace in the Issue Navigator, available through the View > Navigators > Issues menu, to see where the issue is located.

If you find the issue is pointing at an Apple framework, please use Feedback Assistant to open a bug report to let us know, and include the complete backtrace shown in the issue navigator. You can post the FB numbers to this thread for visibility. Further, if you can't identify where the issue is coming from, as the backtrace points to your main function, please also let us know, including the provided backtrace.

If you find the runtime issue is resulting from an Apple API call used in a sub-optimal way within a third-party library that your app uses, please open a bug report with the library vendor.

I get the same warning in XCode14 Beta 5 in my objective C main() when it calls UIApplicationMain(argc, argv, nil, nil); (See below)

I use a WKWebView to allow user to login.

For me it seems to happen if I display a WkWebView when I start my Aop. If I run and don't need to display the WkWebView (Ie I already have login details) then I don't seem to get the warning...

int main(int argc, char *argv[]) {

    @autoreleasepool {

        int retVal = UIApplicationMain(argc, argv, nil, nil);

        return retVal;

    }

}

All a bit worrying but I have no clue what it means.

Happening to me too. Someone please solve this

I also encountered the same phenomenon.

However, depending on the loading URL, this message may or may not be displayed.

I'm not quite sure what the difference is.

When this message was not displayed, the following message was displayed.

Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

Xcode Version 14.0 beta 6 (14A5294g)

iOS16.0 beta 8

iPhone SE 2generation

Any solutions on this? Someone please solve this.

Xcode 14 Beta 5 iOS 16.0

Same here!

Same here on Xcode 14 beta 6 / iOS 16.0 beta 8. Would love to know if any updates.

same for me a warning error : This method should not be called on the main thread as it may lead to UI unresponsiveness.

I'm experiencing the same thing with WkWebView (not in SwiftUI).

Xcode 14.0 beta 6 (14A5294g)

Same here with UIKit, AppDelegate and WKWebView. Points to class AppDelegate in the warning... no other information.

If you are continuing to see this when using Xcode 14 Release Candidate running an app on iOS 16 Release Candidate, please provide detailed specifics in a bug report., and then post the FB number here.

It was the same on iOS16RC&xcode14RC. Posted: FB 11480364

Yep WkWebView.load(URLRequest) in a UIKit app causes this issue for me in the Xcode 14 RC.

Same error using Xcode Version 14.0 (14A309), iOS16 on iPad. Using WkWebView with SwiftUI.

Same error for me happening

Facing the same issue, any solution or workaround?

10
"UI unresponsiveness" warning on @main
 
 
Q