Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

[C3 Runtime] Facebook Instant games don't load the game #2002

Closed masscube closed 6 years ago

masscube commented 6 years ago

Problem description

The Facebook Instant App don't start on Android 8 (Samsung Galaxy S7) :

Screenshot

Attach a .c3p

Example Project

Zip-File for facebook

Steps to reproduce

  1. Load the example project (Switch to construct 3 runtime)
  2. Export the project for instant games
  3. Zip all files and upload to fb instant games
  4. Load the game on android
  5. (Don't load anything)

Observed result

Screenshot (Always 0%)

Expected result

Loading the game.

Affected browsers

System details

View details Platform information Browser: NW.js Browser version: 0.31.2 Browser engine: Chromium Browser architecture: 64-bit Context: nwjs Operating system: Windows Operating system version: 10 Operating system architecture: 64-bit Device type: desktop Device pixel ratio: 1 Logical CPU cores: 8 Approx. device memory: 8 GB User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (@878cd31214ac27a3996927cd5c9c138b10c9fc8d) NWjs/0.31.2 (like Chrome/67.0.3396.87) C3 release: r115 (beta) Language setting: en-US Local storage Storage quota (approx): 54 gb Storage usage (approx): 1.2 gb (2.3%) Persistant storage: Yes Browser support notes This list contains missing features that are not required, but could improve performance or user experience if supported. Nothing is missing. Everything is OK! WebGL information Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium) Numeric version: 2 Supports NPOT textures: yes Supports GPU profiling: no Vendor: Google Inc. Renderer: ANGLE (NVIDIA GeForce GTX 1060 6GB Direct3D11 vs_5_0 ps_5_0) Major performance caveat: no Maximum texture size: 16384 Point size range: 1 to 1024 Extensions: EXT_color_buffer_float EXT_texture_filter_anisotropic OES_texture_float_linear WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context Audio information System sample rate: 48000 Hz Output channels: 2 Output interpretation: speakers Supported decode formats: Ogg Opus (audio/ogg; codecs=opus) WebM Opus (audio/webm; codecs=opus) Ogg Vorbis (audio/ogg; codecs=vorbis) WebM Vorbis (audio/webm; codecs=vorbis) MPEG-4 AAC (audio/mp4; codecs=mp4a.40.5) MP3 (audio/mpeg) FLAC (audio/flac) PCM WAV (audio/wav; codecs=1) Supported encode formats: WebM Opus (audio/webm; codecs=opus) Video information Supported decode formats: WebM VP9 (video/webm; codecs=vp9) WebM VP8 (video/webm; codecs=vp8) Ogg Theora (video/ogg; codecs=theora) H.264 (video/mp4; codecs=avc1.42E01E) Supported encode formats: WebM VP9 (video/webm; codecs=vp9) WebM VP8 (video/webm; codecs=vp8)
masscube commented 6 years ago

Don't work on my chrome-browser (PC) too..

AshleyScirra commented 6 years ago

Did you export minified? That currently doesn't work due to #1979.

masscube commented 6 years ago

No, without minified! The export works great, but when i upload the exported project to facebook instant games - the game don't load. (the problem is on android AND on my PC) (always 0 % on the loading screen). In the project is nothing, only the facebook instant games plugin.

In the chrome-console on my pc i get this error-message when i start the app on facebook instant games:

c3runtime.js:40 Uncaught (in promise) TypeError: Failed to fetch at Function.C3.FetchOk (c3runtime.js:40) at Function.C3.FetchBlob (c3runtime.js:40) at C3.CanvasManager._LoadSvgSplashImage (c3runtime.js:349) at C3.CanvasManager.InitLoadingScreen (c3runtime.js:349) at C3.Runtime._InitialiseCanvas (c3runtime.js:352) at C3.Runtime.Init (c3runtime.js:352)

AshleyScirra commented 6 years ago

What is the URL that failed to fetch? It should also appear in the log or the network tab.

masscube commented 6 years ago

Refused to connect to 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHdpZHRoPSIxNzAwL...ExMzcuMTg1NTUsNzU4LjExMzI4di03My4xNjc5N2wtNjMuMzY1MjMsMzYuNTgzOTgNCgkJCQlMMTEzNy4xODU1NSw3NTguMTEzMjhMMTEzNy4xODU1NSw3NTguMTEzMjh6IE0xMDI2LjU3NjE3LDcwNS4xNjQwNmwxMjAuMDU4NTktNjkuMzE2NDENCgkJCQljMTIuNTY4MzYtNy4yNTU4NiwyOC4zNDQ3MywxLjg1MjU0LDI4LjM0NTcsMTYuMzY2MjF2MTM4LjYzMDg2Yy0wLjAwMDk4LDE0LjUxMjctMTUuNzc3MzQsMjMuNjIyMDctMjguMzQ1NywxNi4zNjYyMQ0KCQkJCWwtMTIwLjA1ODU5LTY5LjMxNjQxQzEwMTQuMDI4MzIsNzMwLjY0OTQxLDEwMTQuMDI4MzIsNzEyLjQwOTE4LDEwMjYuNTc2MTcsNzA1LjE2NDA2eiIvPg0KCQk8L2c+DQoJPC9nPg0KPC9nPg0KPC9zdmc+DQo=' because it violates the following Content Security Policy directive: "connect-src * wss:".

.. and ...

c3runtime.js:40 Refused to connect to 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAABABAMAAACekdKMAAAAMFBMVEUAAAByfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYZyfYYgo7vbAAAAD3RSTlMAdxHdu4hmVZnuRMwzqiLYE4y2AAAF2klEQVR42u2Yv28jaRnHP/bG8SVxvA4ncRw6sCVoVlc4R8FJCOHlGkq7olrJy18QFzRUWSqkE1KibZAQOkc6Ua+5htJGW12BEihpHAqKE0XWcZzEcXIfinf8a8zunsTNoZPmW80zfsbvzGfmfX5BqlSpUqVKlSpVqlSpUqVKlSrV/1EHPv4SfN7wMgWQAkgBpABSAF+2HngOsG8PyDpsWwHy3gJU/UHM3o0uyxw4/G44zJf1LQC8INP3ugXAejOcrqn6EIf80puiQwDqHgF8S987nfsAcN+HfEd/M/v34TtwT9WLBABsewXQtAHkHfVtATlHA...B9znqB73k+9YkDoBYx+gByyQHoayt08I0wIomif/R1L9vPhz3Y9w/A9x1Nu8H1qBucATj2Eii07UHZxhxA2Q7wqaEb7EG2bmPq83zYWwawHxqj5rAXiu1ktB8+42rgQF6fhqbuilW7HnpzH5Gp2ZnOA/qOWAKQ039QLHsHPPN3VKY/nnlxxB91Ng9408nMp25nGUBO3yO4bDpuZZMBUA2Y16LtnA3Zm7pPWbVrvphNhCaV+einsQyAg3D6E8I8b3f6Yyac7y5MhOY+NV8sA6A5d6npMKk8eBluLSr0umE/lsNzx+y6u7OZYIPZ8O99YgDW2xptokJ7AUAA9uOD+UxwwafubgxAvjZz+TQxAJlQbhSn445yCNRn06y3ZD8fHkVT4YtvzKfC3yQOgExT/xa6nX9pYwag+Kb+nOZsKvzTBZ/nw6MYAPJl/XW4sJlcFEiVKlWqVKlSpUqVKlWqVKlSpUqV6uuu/wDv59f7eYDABQAAAABJRU5ErkJggg==' because it violates the document's Content Security Policy.

AshleyScirra commented 6 years ago

If you change the splash style to something other than "C3 splash", does it work?

It looks like Facebook's security settings are blocking it loading some images, which they'd need to fix on their end.

masscube commented 6 years ago

Ok, i have changed the loader style in the settings to nothing. It works on PC (chrome), but on android i have always the same problem: Same Problem - Screenshot

masscube commented 6 years ago

I'm testing it with the remote chrome console on android, and i get this error (from android) when i start the app directly on instant games:

Failed to load resource: the server responded with a status of 404 () /instant-bundle/1968329893212011/1439606146141707/workerMain.js:1

EDIT: Ok, i think this is a webworker problem. When i activate the checkbox Use Webworker, the app loads on facebook, but after loading, i get always a black screen!? This Warning comes from Android:

Failed to register service worker: TypeError: Failed to register a ServiceWorker: A bad HTTP response code (400) was received when fetching the script. window.C3_RegisterSW @ register-sw.js:1

AshleyScirra commented 6 years ago

This sounds like some export bugs when using the C3 runtime that ought to be fixed in the next release. Let's check again when it comes out and see if that resolves it.

AshleyScirra commented 6 years ago

r116 is out now, can you verify if it works with that?

masscube commented 6 years ago

No, not work on Android. Here the error (console) from android : Screenshot Chrome-Console / Android

Worker is unchecked on the project.

AshleyScirra commented 6 years ago

Does it work if you change the loader splash style to something else?

AshleyScirra commented 6 years ago

It looks like this is caused by the Instant Games CSP blocking the splash images from loading. I've updated the next release to be more robust and allow loading to complete even if splash images fail to load, let's see if that helps when it's out.

masscube commented 6 years ago

It works when I set the loaderstyle to nothing!

EDIT: .. but when I checked the minify script (export) on, the game not load.

AshleyScirra commented 6 years ago

This should be working better with r117.2. Can you check if that works for you?

AshleyScirra commented 6 years ago

Facebook have also said they have made a change on their end which should fix this. Can you verify that it is working?

masscube commented 6 years ago

Now, the game works on facebook when i activate minify script. Thanks 👍

I found only another problem with the Tweeen plugin after minify:

c3runtime.js:2 Uncaught (in promise) TypeError: ease[this.g_aGG.g_aHd] is not a function at g_bs.g_TT.g_aGg.g_EZ.g_FP (c3runtime.js:2) at gbs.g$n.g_abF (c3runtime.js:2) at gbs.g$n.g_abL (c3runtime.js:2)

... but i'm post the problem directly to the tweeen-plugin topic.

AshleyScirra commented 6 years ago

Thanks for confirming. Please report issues in third-party addons to their developers.