[facebook instant games] モバイル端末でのみエラー (is problems only for physics2?)

** 環境

  • GDevelop 5.0.0-beta88
  • ローカル開発環境はMacOS
  • GDevelop歴半年

** 相談内容
GDevelopでfacebook instant games用にpublishしたzipをそのままfacebook for developersのテストアプリのウェブホスティングにアップロードして実行しています。


AndroidをUSB Debug(Remote Device at Chrome)可能にしてtraceすると以下のerror messageが出ています。


[Intervention] Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.


Uncaught TypeError: Module.getCache is not a function
at eval (eval at O (box2d.js:8), :1:80)
at _emscripten_asm_const_int (box2d.js:172)
at sw (box2d.js:190)
at Qy (box2d.js:186)
at yy (box2d.js:186)
at Hh (box2d.js:182)
at F.Step (box2d.js:667)
at gdjs.Physics2SharedData.step (physics2runtimebehavior.js:94)
at gdjs.Physics2RuntimeBehavior.doStepPreEvents (physics2runtimebehavior.js:548)
at gdjs.Physics2RuntimeBehavior.gdjs.RuntimeBehavior.stepPreEvents (runtimebehavior.js:56)
at gdjs.TiledSpriteRuntimeObject.gdjs.RuntimeObject.stepBehaviorsPreEvents (runtimeobject.js:935)
at gdjs.RuntimeScene._updateObjectsPreEvents (runtimescene.js:464)
at gdjs.RuntimeScene.renderAndStep (runtimescene.js:274)
at gdjs.SceneStack.step (scenestack.js:36)
at runtimegame.js:471
at gameLoop (runtimegame-pixi-renderer.js:370)


ゲームは、error message からもわかりますが、Physics2を中心に作っています。
facebook instant gamesではなく自前のS3にホスティングしてモバイル端末のchromeやsafariで開くと正常に動作しています。
facebook instant gamesにテストアプリとして配置してfbアプリのwebviewで実行される場合のみ、エラーが発生しているように思います。

(replying in English)
Are you able to share with me the game triggering the error, as a zip file or with a link? I can take a look at the issue then.

thx 4ian
sent the URL of the source file to your email (Florian[dot]Rival[at]gmail.com).

ExampleにあるPhysics2を使った「Ragdoll」をfb instant gamesにデプロイしても、同じ現象でした(同じエラーで、描画が止まり、動作しませんでした)。

When deploying “Ragdoll” using Physics2 in the example to fb instant games, the same situation occurred (drawing stopped and did not work with the same error).

試しに、GDevelop4でExampleゲームの「Physics」をfb instant gamesに上げてみましたが、やはり同じエラー「Uncaught TypeError: Module.getCache is not a function」が出ていました。

これは、GDevelopでは物理を使ったゲームをfb instant gamesに乗せられないバグなのではないでしょうか?

I tried the “Physics” of the Example game to fb instant games in GDevelop4, but again the same error
“Uncaught TypeError: Module.getCache is not a function” appeared.

Is’nt work GDs Physics Game on fb instant games because of GD bug?
please give me advice.

Sorry for the delay. I think it might be a Facebook Instant Games related bug, because when I package and publish it as an instant games, it:

  • Works on desktop
  • Works on mobile when launched in the browser (using fb.gg/play/xxxx url)
  • Freeze on mobile in the app.

Looking more what can be happening…

I fixed the issue for next version :slight_smile:
Unfortunately there was a conflict between instant games and the physics engine.

If you can’t wait for next version, you can:

  • Export your game as a facebook instant game zip.
  • Extract the zip in a folder
  • Replace the file Extensions/Physics2Behavior/box2d.js by the new one that you can download here.
  • Compress again all the files in a single zip. Be sure that the index.html is at the root of your zip (there must NOT be a folder - Facebook Instant Games won’t accept it)

Let me know if that works for you :slight_smile:
Next version will have this issue solved. I’ll upload it as soon as I can.

Thanks for you patience!

This is fixed in the new version: Release 5.0.0-beta89 · 4ian/GDevelop · GitHub :slight_smile:

Hi 4ian,

As you said, it worked by replacing box2d.js.
We will continue working on the beta-89 release.

Thank you for everything!

1 Like

Happy that it works :+1: