Jump to content

Phaser game, Cordova build issue


mitko993
 Share

Recommended Posts

Hello,

I have a simple game made with Phaser. The game runs like it should in Chrome browser and in browser mobile view but when i build it with Cordova and install it on Android device all the images are missing. The game works fine, but every single one of the images is gone (it replaces the original images with the green missing image icon).

My game is organized in one www folder (inside: code, scripts, css, images folders and index.html). I create a new Cordova project (from console), install the android platform (cordova platform add [email protected]). Once the project is created i replace the Cordova project www folder with mine and run the build.

I don't understand why does it run good in browser but on mobile it cant find the images.

P.S. I forgot to mention, the first time i build the app with cordova it did work good. Then i just added a new state (made no changes to the existing code) and when i tried the new build this issue occured. I tried different phones, and new cordova projects but it didn't help.

Link to comment
Share on other sites

17 hours ago, VitaZheltyakov said:

Try running CordovaProject/www/index.html

If i just start index.html in my browser i get error: XMLHttpRequest cannot load because i am fetching some files with 'game.load.json' and then accessing them from cache. In the final version these files would be on the Server and downloaded when needed. But for right now i don't think they should make any problems.

Do you think this is the problem why my game won't start ? If yes, then why did it work on the very first build?

Link to comment
Share on other sites

4 hours ago, mitko993 said:

If i just start index.html in my browser i get error: XMLHttpRequest cannot load because i am fetching some files with 'game.load.json' and then accessing them from cache. In the final version these files would be on the Server and downloaded when needed. But for right now i don't think they should make any problems.

Do you think this is the problem why my game won't start ? If yes, then why did it work on the very first build?

You need to add cordova-plugin-inappbrowser

Link to comment
Share on other sites

21 hours ago, VitaZheltyakov said:

You need to add cordova-plugin-inappbrowser

I do install it manually but it still it doesn't work.

Could you tell me how can i check for sure that the inappbrowser plugin is installed correctly ?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...