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 android@4.1.1). 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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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