[Troubleshoot] [Cordova + Phaser 3] The preloader scene is being refreshed

Hello everyone

I don’t know if that was the correct place to post about that problem but I didn’t know where to post especially I did the same with a previous game called C-Square and it worked fine.

I made a boot scene to preload a bitmap font Then in my preload scene I am adding a line that says “Loading…” while loading other stuff such as images, sounds, music. I am using Cordova to compile to iOS and Android. It works well with the android but with iOS the preloading scene is kept resetting or getting halt every single time I add BitmapText or Text or anything in the scene.

Sorry for disturbance and Thanks in advance

So I found that Phaser 3 restart scenes if there is an exception so I put a try catch around the add line and catched the exception and that what I found in the log

" {“line”:20421,“column”:30,“sourceURL”:“file:///var/containers/Bundle/Application/959168A7-3444-471D-AF48-031BD7DD3524/ELIMINATION.app/www/js/phaser.js”}"

That’s kinda weird because that is the line where the system get the bitmap font from the system. I don’t know why it is throwing the exception when it is working on other platforms web, android fine. (I preload the bitmap font in booting scene before going to the preloading)

Interestingly I have been having a ton of errors when porting my cordova game from Android to iOS. From the quick glance I did it looked like it was an issue with missing assets so I’m wondering if this is related. I’ve been busy with a big update to the Android version so I put the port on hold for the time being. I’m interested to see how your problem develops.

I don’t think the asset is missing because it loaded in the booting scene and it didn’t throw any errors. Also, I don’t get, why it would only happen for the iOS than Android or Web? Looking forward to see if anyone have an issue with that and it is not only with that object when I commented it all lines of code after the loading that added an object that uses any asset (including normal text) cause exceptions.

So people online suggested that it might be related that the loader in Phaser3 uses XHR protocol which is not good in loading file:// which is used in Cordova apps so I tried https://github.com/oracle/cordova-plugin-wkwebview-file-xhr and now it loads but the whole game screen when starts is a little fucked up anything that suppose to be in the center of the screen is not appearing.
(This only happens on iOS)
so I checked the aspect ratio and I found with that it makes screen.width < screen.height even in landscape mode at deviceReady which was weird for me. Then when I ran it random asset sheets were shown as background (stretched over the background) and any rect fill command is flickering. The game is playable but look like shit. I don’t know what to do any more. Any help?

Here is some of the weird screens that are happening on the iOS side

So I used an image to cover the camera background to remove that problem and it worked but now I am faced with a problem any thing using Graphics object is flickering on the iOS all the time. I might need to use images to fix that but I think there must be a way to fix that bug. Also sometimes the play sound from phaser doesn’t work when the app is minimized and restored without no errors in the console or anything. Any ideas what is the reason?

Another weird bug, happening more often on new iPhones than Android which is the sound for SFX doesn’t play sometimes (which was easy to play using Phaser2). I even added every single extension to do make sure that the SFX are playing but nothing. There is no errors in the console at all which I can’t figure out why this is happening to me.

hi, I am having problem with ios too and some of the assets in my game are not showing up. do you possibly know why? did you get to solve your problem?