Game freezes in Android, plays good in flash player

isographer

  • Posts: 7
Hello,
I am building a mock-up for a future game i have in mind.
Right now it's only with sticks and a white background, as I am testing the generation of some elements that my player will navigate through.
Although what I have don so far plays as expected in Flash player it does not run good on Android - meaning that the game will freeze in less than two seconds.



Here is the log from one of the sessions in android and attached to this post is the main code of the scene:

(the ideea is to create a series of lines (for the moment, they will be replaced with much better designed obstacles later on) running from the left to the right of the screen using some random no. generation functions.  There are 2 types of "lines"  (red and black ) representig the two types of obstacles .



[LOG] Running command: TRACE
[LOG]  - Changing directory: C:\Users\Laurentiu\AppData\Roaming\Stencyl\stencylworks\android-sdk/android-sdk-windows//platform-tools/
[LOG]  - Running command: adb.exe logcat -c
[LOG]  - Changing directory: C:\Users\Laurentiu\AppData\Roaming\Stencyl\stencylworks\android-sdk/android-sdk-windows//platform-tools/
[LOG]  - Running command: adb.exe logcat
[LOG] --------- beginning of /dev/log/main
[LOG] --------- beginning of /dev/log/system
[LOG] I/trace   (32381): Universal.hx:162: Stage Width: 800
[LOG] I/trace   (32381): Universal.hx:163: Stage Height: 480
[LOG] I/trace   (32381): Universal.hx:164: Screen Width: 800
[LOG] I/trace   (32381): Universal.hx:165: Screen Height: 480
[LOG] I/trace   (32381): Universal.hx:166: Screen DPI: 234.4615326
[LOG] I/trace   (32381): Universal.hx:197: Widescreen (Aspect Ratio > 1.5)
[LOG] I/trace   (32381): Universal.hx:162: Stage Width: 800
[LOG] I/trace   (32381): Universal.hx:163: Stage Height: 480
[LOG] I/trace   (32381): Universal.hx:164: Screen Width: 800
[LOG] I/trace   (32381): Universal.hx:165: Screen Height: 480
[LOG] I/trace   (32381): Universal.hx:166: Screen DPI: 234.4615326
[LOG] I/trace   (32381): Universal.hx:302: Theoretical Scale: 1
[LOG] I/trace   (32381): Universal.hx:314: Max Scale: 1
[LOG] I/trace   (32381): Universal.hx:315: Engine Scale: 1x
[LOG] I/trace   (32381): Universal.hx:381: 800
[LOG] I/trace   (32381): Universal.hx:382: 480
[LOG] I/trace   (32381): Universal.hx:383: true
[LOG] I/trace   (32381): Universal.hx:455: Algorithm: No Scaling (Integer Scaling)
[LOG] I/trace   (32381): Universal.hx:556: Scale X: 1
[LOG] I/trace   (32381): Universal.hx:557: Scale Y: 1
[LOG] I/trace   (32381): Universal.hx:197: Widescreen (Aspect Ratio > 1.5)
[LOG] I/trace   (32381): Universal.hx:302: Theoretical Scale: 1
[LOG] I/trace   (32381): Universal.hx:314: Max Scale: 1
[LOG] I/trace   (32381): Universal.hx:315: Engine Scale: 1x
[LOG] I/trace   (32381): Universal.hx:381: 800
[LOG] I/trace   (32381): Universal.hx:382: 480
[LOG] I/trace   (32381): Universal.hx:162: Stage Width: 800
[LOG] I/trace   (32381): Universal.hx:383: true
[LOG] I/trace   (32381): Universal.hx:455: Algorithm: No Scaling (Integer Scaling)
[LOG] I/trace   (32381): Universal.hx:556: Scale X: 1
[LOG] I/trace   (32381): Universal.hx:163: Stage Height: 480
[LOG] I/trace   (32381): Universal.hx:557: Scale Y: 1
[LOG] I/trace   (32381): Universal.hx:164: Screen Width: 800
[LOG] I/trace   (32381): Universal.hx:165: Screen Height: 480
[LOG] I/trace   (32381): Universal.hx:166: Screen DPI: 234.4615326
[LOG] I/trace   (32381): Purchases.hx:32: Purchases: Started
[LOG] I/trace   (32381): Purchases.hx:32: Purchases: Started
[LOG] I/trace   (32381): Universal.hx:197: Widescreen (Aspect Ratio > 1.5)
[LOG] I/trace   (32381): Universal.hx:302: Theoretical Scale: 1
[LOG] I/trace   (32381): Universal.hx:162: Stage Width: 800
[LOG] I/trace   (32381): Universal.hx:314: Max Scale: 1
[LOG] I/trace   (32381): Universal.hx:163: Stage Height: 480
[LOG] I/trace   (32381): Universal.hx:164: Screen Width: 800
[LOG] I/trace   (32381): Universal.hx:165: Screen Height: 480
[LOG] I/trace   (32381): Universal.hx:166: Screen DPI: 234.4615326
[LOG] I/trace   (32381): Universal.hx:315: Engine Scale: 1x
[LOG] I/trace   (32381): Universal.hx:197: Widescreen (Aspect Ratio > 1.5)
[LOG] I/trace   (32381): Universal.hx:381: 800
[LOG] I/trace   (32381): Universal.hx:302: Theoretical Scale: 1
[LOG] I/trace   (32381): Universal.hx:382: 480
[ERR] java.lang.NullPointerException
[LOG] I/trace   (32381): Universal.hx:314: Max Scale: 1
[LOG] I/trace   (32381): Universal.hx:383: true
[LOG] I/trace   (32381): Universal.hx:315: Engine Scale: 1x
[LOG] I/trace   (32381): Universal.hx:455: Algorithm: No Scaling (Integer Scaling)
[ERR] java.lang.NullPointerException
[LOG] Unexpected problem on thread AWT-EventQueue-0: null
[LOG] I/trace   (32381): Universal.hx:381: 800
[LOG] I/trace   (32381): Universal.hx:556: Scale X: 1
[LOG] I/trace   (32381): Universal.hx:382: 480
[LOG] I/trace   (32381): Universal.hx:557: Scale Y: 1
[LOG] I/trace   (32381): Universal.hx:383: true
[LOG] I/trace   (32381): Universal.hx:455: Algorithm: No Scaling (Integer Scaling)
[LOG] I/trace   (32381): Universal.hx:556: Scale X: 1
[LOG] I/trace   (32381): Universal.hx:557: Scale Y: 1
[LOG] I/trace   (32381): Universal.hx:162: Stage Width: 800
[LOG] I/trace   (32381): Purchases.hx:32: Purchases: Started
[LOG] I/trace   (32381): Universal.hx:163: Stage Height: 480
[LOG] I/trace   (32381): Universal.hx:164: Screen Width: 800
[LOG] I/trace   (32381): Universal.hx:165: Screen Height: 480
[LOG] I/trace   (32381): Universal.hx:166: Screen DPI: 234.4615326
[LOG] I/trace   (32381): Universal.hx:197: Widescreen (Aspect Ratio > 1.5)
[LOG] I/trace   (32381): Universal.hx:302: Theoretical Scale: 1
[LOG] I/trace   (32381): Universal.hx:162: Stage Width: 800
[LOG] I/trace   (32381): Universal.hx:314: Max Scale: 1
[LOG] I/trace   (32381): Universal.hx:163: Stage Height: 480
[LOG] I/trace   (32381): Universal.hx:164: Screen Width: 800
[LOG] I/trace   (32381): Universal.hx:165: Screen Height: 480
[LOG] I/trace   (32381): Universal.hx:315: Engine Scale: 1x
[LOG] I/trace   (32381): Purchases.hx:32: Purchases: Started
[LOG] I/trace   (32381): Universal.hx:166: Screen DPI: 234.4615326
[LOG] I/trace   (32381): Universal.hx:381: 800
[LOG] I/trace   (32381): Universal.hx:382: 480
[LOG] I/trace   (32381): Universal.hx:383: true
[LOG] I/trace   (32381): Universal.hx:197: Widescreen (Aspect Ratio > 1.5)
[LOG] I/trace   (32381): Universal.hx:455: Algorithm: No Scaling (Integer Scaling)
[LOG] I/trace   (32381): Universal.hx:302: Theoretical Scale: 1
[LOG] I/trace   (32381): Universal.hx:556: Scale X: 1
[LOG] I/trace   (32381): Universal.hx:314: Max Scale: 1
[LOG] I/trace   (32381): Universal.hx:557: Scale Y: 1
[LOG] I/trace   (32381): Universal.hx:315: Engine Scale: 1x
[LOG] I/trace   (32381): Universal.hx:381: 800
[LOG] I/trace   (32381): Universal.hx:382: 480
[LOG] I/trace   (32381): Universal.hx:383: true
[LOG] I/trace   (32381): Universal.hx:455: Algorithm: No Scaling (Integer Scaling)
[LOG] I/trace   (32381): Universal.hx:556: Scale X: 1
[LOG] I/trace   (32381): Universal.hx:557: Scale Y: 1
[LOG] I/trace   (32381): Purchases.hx:32: Purchases: Started
[LOG] I/trace   (32381): Purchases.hx:32: Purchases: Started

panda84

  • Posts: 28
Hi did you ever figure out what this was? I have the same problem. I set up a test game to debug. The game only has two doodad actors with no logic involved. It crashes 90% of the time on android and the same null pointer exception errors appear in the log. The crash happens about half a second after the game loads onto the phone. Running 4.4.2. No problems on iOS or flash.

Jon

  • *
  • Posts: 17524
Crashing isn't the same as freezing, assuming the original poster really meant freezing (as in the game locks up but stays alive).

The latter is usually a user-induced logic error of some sort. Crashing is easier to figure out if you run the game in debug mode (from the Debug menu). This will generate a pretty readable stacktrace that you can share here.