I forgot to mention something i have experinced with agk?
Some app crashes did i solve by converting gosubs to functions that are called during a game loop.
This app crash is extremely weird as they work mostly great but sometimes throws some weird crashes?
So my recomendation is that you dont use gosubs and try to use functions instead.
I still use them to initialize alot Before the loop but try to not use gosubs inside the loop where they get accesed in many frames per second.
I got to Think about it as i whas going thru vans and my game where he added some new stuff ingame that causes these crashes currently.
He made the Death and stats part as gosub calls and they cause these crashes now again
I Think i have forgot to mention this Discovery by me ?
I only wanted to mention this as it whas extremely annoying until i discovered that by simply converting some gosub calls to functions solved some of them

I have only experinced this when they are called many times in an loop.
edited ......................
Another thing is that you could also try to do a if sprite exist check Before you do anything with an sprite also?
There seam to be some fragmentation sometimes that could cause some crashes as agk throws the wrong id and simply crashes.
And if you can so avoid using virtual buttons.
The things i have mentioned is things i have experinced with large Projects.
Not that comon on my smaller test snippets.
edited 2 .....................
About the gosubs so is there something when they use the return command?
As vans calls are only called when a key is pressed and then using a loop inside that.
I have only had these gosub crashes Before when an gosub whas called many times inside an loop ?
Its weird
Gosubs seams broken if called from Another file then the main file ?
edited 3 .......
Also when you empty an string!
Do it like this.
settextstring(TXT_Inventory,"")
do not do it like this!!!!
settextstring(TXT_Inventory," ")
Agk seam to leave garbage if you do so and throw weird crashes when you then tryes to assign an new string later on it.
Sorry for all the editing but iam tired an remember stuff that gave me painfull experiences after i post.
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz