THREAD WARNING: ['StatusBar'] took '15.460938' ms. Plugin should use a background thread

This thing is taking too much time on splash screen to load the app.

THREAD WARNING: ['StatusBar'] took '15.460938' ms. Plugin should use a background thread.

How can I solve this problem ?

You can’t, you would have to change the plugin to work differently (and I am not sure if this is possible).

Is this on a real device or on an emulator?

This is happening when I run my app on real device through Xcode.

One year ago it was discussed that this warning could be ignored as long as the performance looks ok, furthermore might only happens like you said when debugging a real phone with Xcode…BUT don’t know if this is correct and still actual, just wanted to link what I found

1 Like

I avoided that warning by going manually in the plugins and opened status_bar file

path where you can find that file
plugins -> status_bar -> src -> ios -> CDVStatusbar.m

In this file search for the function which you are using in your application
In my case I was using showStatusBar function.

This create a background thread.

[self.commandDelegate runInBackground:^{
    // the create method goes here

Use the above method in your code.
code :

(void) showStatusBar
[self.commandDelegate runInBackground:^{
// the create method goes here
    if (_uiviewControllerBasedStatusBarAppearance) {
        CDVViewController* vc = (CDVViewController*)self.viewController;
        vc.sb_hideStatusBar = [NSNumber numberWithBool:NO];
        [self refreshStatusBarAppearance];

    } else {
        UIApplication* app = [UIApplication sharedApplication];
        [app setStatusBarHidden:NO];
1 Like

What effect does using this function have?

this only avoids the warning.

Yeah but what are the side effects? Putting stuff on a background thread probably does something, otherwise it would be the default, right?

yes then it would be the default