problem with android kitkat

Monkey Forums/Monkey Bug Reports/problem with android kitkat

slenkar(Posted 2015) [#1]
when using android kitkat

I minimise the app and bring it up again,
it crashes on a pushmatrix line

this happens with the old android target and the new android target on android kitkat
(but not with other targets like html5)

crash log:
I/[Monkey](17510): Monkey Runtime Error : length=6; index=6
I/[Monkey](17510): /root/Dropbox/Monkey/modules/mojo/graphics.monkey<365>
I/[Monkey](17510): /root/Dropbox/monkeygames/mapper/guis.monkey<716>
I/[Monkey](17510): /root/Dropbox/monkeygames/mapper/guis.monkey<658>
I/[Monkey](17510): /root/Dropbox/monkeygames/mapper/mapper.monkey<91>
I/[Monkey](17510): /root/Dropbox/Monkey/modules/mojo/app.monkey<113>
E/SensorManager(17510): Exception dispatching input event.


in my code the crash happens after a pushmatrix and 2 translates in a row


marksibly(Posted 2015) [#2]
Does it happen with the samples too? If not, sample code please!

Anyone else had any problems with kitkat?


slenkar(Posted 2015) [#3]
heres what happens with the bouncyaliens sample:
(after minimizing and bringing back the game)
im using v81b by the way

I/[Monkey](24895): BouncyAliens: OnSuspend
E/PlayEventLogger(24989): Invalid device id d1786d5845848f3f
E/com.amazon.venezia/com.amazon.identity.auth.device.framework.MAPApplicationInformationQueryer(23492): Notified by action android.intent.action.PACKAGE_CHANGED to invalidate app cache
E/com.amazon.kindle/com.amazon.identity.auth.device.framework.MAPApplicationInformationQueryer(24944): Notified by action android.intent.action.PACKAGE_CHANGED to invalidate app cache
E/com.amazon.mp3/com.amazon.identity.auth.device.framework.MAPApplicationInformationQueryer(24912): Notified by action android.intent.action.PACKAGE_CHANGED to invalidate app cache
I/[Monkey](24895): Display modes:
I/[Monkey](24895): Monkey Runtime Error : length=5; index=5
I/[Monkey](24895): /root/Dropbox/Monkey/modules/mojo/graphics.monkey<479>
I/[Monkey](24895): /root/Dropbox/Monkey/modules/mojo/graphics.monkey<365>
I/[Monkey](24895): /root/Dropbox/Monkey/modules/mojo/graphics.monkey<482>
I/[Monkey](24895): /root/Dropbox/Monkey/bananas/mak/bouncyaliens/bouncyaliens.monkey<150>
I/[Monkey](24895): /root/Dropbox/Monkey/bananas/mak/bouncyaliens/bouncyaliens.monkey<150>
I/[Monkey](24895): /root/Dropbox/Monkey/modules/mojo/app.monkey<113>
E/SensorManager(24895): Exception dispatching input event.




marksibly(Posted 2015) [#4]
This sounds familiar - app restarts instead of resuming after suspend.

I believe this is what the android:launchmode="singleTop" entry in the manifest was supposed to fix. But apparently not in your case...

Googling 'android app restarting after suspend' gives some interesting results, including:

http://stackoverflow.com/questions/6114480/how-to-resume-android-app-where-it-was-suspended-app-not-activity

which suggests using:

android:alwaysRetainTaskState="true"

and/or...

android:launchMode="singleInstance" //also try: "singleTask", "standard", "singleTop".

Can you try some of these?

I can't reproduce the problem myself and I suspect it's highly device suspect so I doubt even installing kitkat on my nexus 7 would help - Monkey worked fine on Kitkat for me before I upgraded to lollipop.

What device are you using?


slenkar(Posted 2015) [#5]
Im using a pretty cheap generic tablet called 'dopo'
I tried altering the manifest file but when I compile the monkey program the manifest file gets overwritten.

I compiled it with the command line and tried all those options, the same crashes happened unfortunately.

I also tried:
android:launchMode="singleInstance"
android:clearTaskOnLaunch="false"
android:alwaysRetainTaskState="true"
android:finishOnTaskLaunch="false"

It does seem to restart the app every time it is brought back to the screen so you are right about the reason it is happening.


marksibly(Posted 2015) [#6]
> I tried altering the manifest file but when I compile the monkey program the manifest file gets overwritten.

You need to edit the manifest file in 'templates', not the one in the root build dir.


slenkar(Posted 2015) [#7]
ohh ok thanks

When compiled in Release mode it doesnt crash, it just restarts, so I just saved what screen the player was on and restored it in OnCreate it seems to be a good enough solution for this game.


marksibly(Posted 2015) [#8]
Ugh, I'd rather fix this properly!

Did you try messing with the templates/AndroidManifest.xml file?


slenkar(Posted 2015) [#9]
Yes sorry for taking a long time to reply.

I managed to figure out why it was happening.

In the options it had an option to kill the app whenever it is minimized.

This was enabled so disabling it made the games work again.


marksibly(Posted 2015) [#10]
Thanks for the reply!

What 'options'?

Is there something I need to fix for monkey?


slenkar(Posted 2015) [#11]
In the general android settings menu there is an option to make apps terminate when they are minimized.

I dont think there is a need to fix the issue, if you want to have a go, just enable the option

Actually when a monkeygame is compiled in release mode the game doesnt crash at all. So there is no need to fix anything


therevills(Posted 2015) [#12]
@Slenkar - are you talking about the "Developer Option" - "Don't keep activities"?


slenkar(Posted 2015) [#13]
yep that's the one


marksibly(Posted 2015) [#14]
> In the general android settings menu

Still a bit confused - I can't find a 'general android settings menu' in Ted!


therevills(Posted 2015) [#15]
It's within the "Developer Options" on the actual Android device...




marksibly(Posted 2015) [#16]
> It's within the "Developer Options" on the actual Android device...

Aha, but is that a realistic solution? Does the user have to tweak developer options? Or does this developer option override manifest?


slenkar(Posted 2015) [#17]
I cant remember if I set that option myself. I might have.
It doesnt seem likely they would have that enabled on new devices.

There is probably nothing to be done here :)