Jump to content

Phaser 3 on Android device using chromium webview


Stephen Hamilton
 Share

Recommended Posts

Before I create a github issue I thought I'd ask in here if anyone has experienced similar. My issue:

I'm re-building a game using Phaser 3 (has been built in phaser 2 with no issues). It's for web and also device via an app wrapper using chromium webview. Web is all good. App wrapper is fine on iOS. But android is being a bit naughty. The issue presents using the Loader, and loading via a pack file. In the Boot scene I'm loading a couple of config files and images. But its just erroring. What I'm seeing via logcat is this (edited for brevity):

[INFO:CONSOLE(1)] "Boot.loadStart", source: file:///xxx/game_files/js/main.0cda633e.js
[INFO:CONSOLE(1)] "Boot.loadFileProgress | type xml | key copy_xml | src assets/locale/copy.xml", source: file:///xxx/game_files/js/main.0cda633e.js
[INFO:CONSOLE(1)] "Boot.loadError | type xml | key copy_xml | src assets/locale/copy.xml
 -- status : 0 | -- statusText :  | -- response :
<?xml version="1.0" encoding="utf-8"?>
<data>
	* SNIP *
	<item id="results_best"><![CDATA[Best:]]></item>
</data>
[INFO:CONSOLE(1)] "Boot.loadFileProgress | type json | key app_config | src assets/data/config.json", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadError | type json | key app_config | src assets/data/config.json
-- status : 0 | -- statusText :  | -- response :
{
  "game": {
    "start_at_level": 1,
    "lives_to_start": 3
  },
  * SNIP *
}, source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadFileProgress | type json | key loadbar | src assets/ui/spritesheets/loading.json", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadError | type json | key loadbar | src assets/ui/spritesheets/loading.json
-- status : 0 | -- statusText :  | -- response :
{
  "frames": [
    * SNIP *
  ],
  "meta": {
    * SNIP *
  }
}, source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadFileProgress | type image | key img_preload | src assets/ui/dom/img_preload.png", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadFileProgress | type image | key bg_generic | src assets/ui/backgrounds/bg_generic.jpg", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadError | type image | key img_preload | src assets/ui/dom/img_preload.png

-- status : 0 | -- statusText :  | -- response :
[object Blob]", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadError | type image | key bg_generic | src assets/ui/backgrounds/bg_generic.jpg

-- status : 0 | -- statusText :  | -- response :
[object Blob]", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadFileProgress | type image | key bg_transition | src assets/ui/backgrounds/bg_transition.jpg", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadFileProgress | type image | key loadbar | src assets/ui/spritesheets/loading.png", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadError | type image | key bg_transition | src assets/ui/backgrounds/bg_transition.jpg

-- status : 0 | -- statusText :  | -- response :
[object Blob]", source: file:///xxx/game_files/js/main.0cda633e.js (1)
[INFO:CONSOLE(1)] "Boot.loadError | type image | key loadbar | src assets/ui/spritesheets/loading.png

So each file load is triggering and then erroring, and yet the response text indicates that the file has actually loaded! Web and iOS on device all works fine - this is just happening in android on weak android devices (nexus 7 and Kinde Fire 7)

Anyone experienced similar. I tried a variety of things with no success!

Link to comment
Share on other sites

  • 1 year later...

Hi Folks - Bumping this thread as I've run into the same issue. I've updated to the latest stable version v3.21.0-FB and am testing in Chromium webview on Android.  iOS webview is fine, as is running in browser on Android ( chrome ) the issue is specific to webview on android.  The only difference from OP is that this seems to be affecting Spine animation assets. Specifically the spine json and atlas files. 

Thanks Dan

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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