Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Android app crashes first 2 times run then works??? — Gideros Forum

Android app crashes first 2 times run then works???

krl3000krl3000 Member
edited December 2013 in General questions
I've developed a very strange problem. I have an app I've been working on that's been exporting to an APK. Today it started exhibiting a bizarre behavior and I honestly cannot figure out what has changed to cause it. I've even gone so far as to go back to a complete backup from a couple days ago (lua code and android project) and am getting the same behavior. I'm hoping SOMEONE might have a clue because I've been going around in circles on this all day.

Here's what's happening: when I install and run the APK, it crashes right after the Gideros splash screen. I try to run it again, it crashes. I run it a third time and it works! The code works fine in the Gideros Player. I have a couple plugins (admob and facebook) but I've commented out all of the lua code related to them in case they started conflicting (I first noticed the problem while getting facebook to work because for some odd reason facebook was reporting a different hash key than what's generated from the Eclipse command line and the only way I found around it was to create a different signing certificate and generate a new hash; I went back to my originals when I restored the old code after noticing the 2x crash issue. Not sure if they're related or not).

I've tried debugging this in Eclipse and the first two times the last lines in logcat are:

12-09 20:09:50.448: W/EGL_emulation(1765): eglSurfaceAttrib not implemented
12-09 20:09:50.456: D/OpenGLRenderer(1765): Enabling debug mode 0
12-09 20:09:50.460: D/(1765): HostConnection::get() New Host Connection established 0xb8034b00, tid 1777
12-09 20:09:50.480: D/OpenGLRenderer(1765): TextureCache::get: create texture(0xb806d148): name, size, mSize = 1, 1048576, 1048576
12-09 20:09:55.592: W/dalvikvm(1765): Invalid indirect reference 0xa684b048 in decodeIndirectRef
12-09 20:09:55.592: E/dalvikvm(1765): VM aborting

The third time I still get the first fourlines, but I don't get the "Invalid indirect reference" and "VM aborting" lines.

I don't know if the "eglSurfaceAttrib not implemented" is relevant or not. I haven't noticed if it's been in logcat output before but I haven't been looking for it and might not have noticed it previously when the app was working correctly.

Any idea what could be happening here? Could the code somehow be trying to access resources in my project before they're written out to the document directory? (I write out a small sqlite3 database) If so, why might that have started happening since I haven't changed any code related to that. I tried clearing out the app data on my computer and rerunning in Gideros Player to see if I could recreate the same thing when it writes out the database but didn't encounter any problems.

I tried pulling up one of the sample Gideros projects (animated birds) and it exported and played without any problems. I'm not even sure where to go with testing this one at this point. Any advice would be appreciated.

Thanks!

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    @krl3000 usually this error means that in jni what you return is not what you expect or when you forget to cast something. But there has been cases, where this error just jumps without any reason and does not go away, while in other cases same lib/plugin works normally.
    Example:
    http://forums.ouya.tv/discussion/1968/any-ideas-invalid-indirect-reference-0x418575c8-in-decodeindirectref

    What I would suggest to do is to:
    1) comment out all plugin specific Lua code
    2) delete or back up current exported project
    3) do the clean export of Gideros to Android project and try to run it
    4) then install one plugin and try to run it
    5) then uncomment this plugin's lua code and do asset only export and again run it
    6) if there are any more plugins, go to 4)

    That way even if the problem repeats you would know on which plugin it is
  • That's pretty much what I spent all day yesterday doing... systematically going trying to eliminate items from the code, do a clean export to Eclipse, remove plugins, etc. I finally started from a completely new Gideros project and started importing my code and resources into it, exporting frequently and testing along the way. I only have two plugins: AdMob and Facebook.

    Facebook was part of my original issue since for some reason keytool was returning a different hash key than what Facebook was seeing (and Facebook wasn't accepting the key it says was coming from the app when I put that key into their apps page). The AdMob plugin is working. The Facebook plugin is crashing the app as soon as I call authenticate. I'm getting an error in logcat identical to the one Emmanuel reported in http://www.giderosmobile.com/forum/discussion/2929/facebook-android-plugin (Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)) except instead of 0xdeadd00d it's returning 0x00000020 (and a different thread #, of course).

    The next thing I'm going to try is creating a bare-bones project with JUST the Facebook plugin to see if I can recreate that issue. It's odd because before I started encountering these issues and ended up rebuilding my project Facebook was working fine with the debug key and after changing my certificate worked fine except for the app crashing twice on first install. Now it just constantly crashes out the app. I assume there's SOMETHING wrong in how I set the plugin back up but everything LOOKS the same to me and seems to fit the instructions for the Facebook plugin.

    If you have any other suggestions or advice for the Facebook plugin, I'd love to hear it! ;-)

    Ahhhh, the joys of being a programmer.
Sign In or Register to comment.