4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.63k stars 843 forks source link

Tween animation extension and android 4/5 compatibility for exported games #1148

Closed KinkGD closed 5 years ago

KinkGD commented 5 years ago

Hello,

Maybe i'm wrong on this report (or for the Swamp "case"), but i'm facing a bug for some users with Swamp since we released the demo on playstore. For some users, the loading of the game at app launch stop at 96%, and for now i observed that it only occurres on android 5.1 and inferior (tested on my own and i've seen the same issue on android 4.4.4).

I did a lot of test on my android 4 device to try to determine the reason. I tested several projects, examples and features to try to determine if i can reproduce the issue with other games, and i did it (or at least i experienced an issue) : If i export the Tween animation example (pairs) for android, the app load to 100%, then remains stuck at 100%. The app just can't be launched.

So idk what to do actually, maybe i could just exclude all devices on lollipop and previous android version on playstore console, but it seems that the Tween extension only works for android 6.0 (at least) and superior.

any chance for it to be fixed/enhanced in GD ? Or maybe on the build services (changing android compatibility in manifest if this extension is used in project ?).

Bouh commented 5 years ago

Tweens is coded by @Wend1go maybe he have a idea

4ian commented 5 years ago

Probably usage of newer JS syntax like => which are not supported on the system webview powering the games on Android 4.4.4. Starting from Android 5 (or 5.something), system webview is based on Chrome and so have latest JS features.

KinkGD commented 5 years ago

So it's probably something else on lollipop ?

Wend1go commented 5 years ago

I think we forgot to run Babel on https://github.com/4ian/GDevelop/blob/master/Extensions/TweenBehavior/tweenruntimebehavior.js There are still a lot of arrow functions in use. Shifty.js itself isn't using them in the minified version that we are using. Might also be the promises that cause the issue. Are we using them somewhere else in the JS runtime?

4ian commented 5 years ago

Running babel will probably output a lot of things that are hard to read, I would prefer that we fix directly the sources by removing the arrow functions. Though you can try running babel on it to see what's the result like. Might be also promises you're right (https://caniuse.com/#feat=promises). They should not be used anywhere else from what I recall.

Would be great ideally if we could get the console logs. It's possible if the webview of the game is running on Chrome: by connecting your Android device to your computer, activating the debug mode and going to chrome://inspect/#devices, you can see the opened tabs or Chrome process and debug them. Though this won't work with a release apk :/

4ian commented 5 years ago

Also for promise some external libraries (like Shopify if I recall properly) might embed polyfills for Promise. But for now the goal is to keep the core of the game engine (GDJS/Runtime and Extensions) written in plain old, simple JS as much as possible for avoiding this kind of issues - though going forward we could think about adding a lightweight polyfill and remove it in a few years when all devices using old JS engines are dead.

4ian commented 5 years ago

Should be fixed in next version! Closing for now to tidy a bit the list of issues but please re-open if the issue is still there after upgrading to next version.