Error: black screen upon launch ios

Hi everyone, I uploaded the game on iOS and got rejected. They reported an error that there is a black screen upon launch. Everything else is normal, but the black screen between the lauchscreen and the start scene. All the cocos creator games I build are like this. Does anyone know how to fix this error? Thanks you very much.

Do you have anymore information to pass along to help diagnose this. It’s a bit hard to give advice with just a rejection from Apple. What happens when you run this on a real device?

Thanks for your attention.

This is the video I recorded: https://vimeo.com/400125294

When I launched the game, ios launch screen appeared first -> the next is a black screen -> and finally the main loading screen of the game.

This black screen is considered as an error and is the reason why Apple rejected my game.

Is there any way to get rid of this black screen?

You can put an Image in RootViewController before engine start. and removed in main.js file when finish scene loading.

1、RootViewController.mm code:

(void)viewWillAppear:(BOOL)animated {

[super viewWillAppear:animated];

CGRect bounds = [[UIScreen mainScreen] bounds];

UIImageView *backView = [[UIImageView alloc] initWithFrame: bounds];

UIImage *ima = [UIImage imageNamed:@"xxxxxxx.png"];

[backView setImage:ima];

[self.view addSubview:backView];

}

+(void)removeBackLuanch{

UIViewController *rootVC = [[UIApplication sharedApplication].delegate window].rootViewController;

for(UIView* subview in rootVC.view.subviews){

    if([subview isKindOfClass:[UIImageView class]]){

        [subview removeFromSuperview];

    }

}
}

2、main.js when first scene loaded, remove the image.

jsb.reflection.callStaticMethod("RootViewController", "removeBackLuanch");
2 Likes

Thank you so much. It work like a charm !

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.