4

My app has a splash screen activity and that starts an intent for the main activity which has an openGL view in it.

Some users are reporting that the game exits and goes back to the splash.

I'm certain that it's a bug, but it's failing silently and so I don't get any crash reports back.

What can cause it to fail silently like this? in such a way that the app cycles and no Force Close window is seen by the user.

Edit: I have stoped the splash screen restarting by putting noHistory="true" in the manifest for the slapsh activity. Now users just report that it exits silently. What would cause that?!

Edit2: If it's any clue, I recently updated from SDK r10 to SDK r16, I believe I have removed all other changes, I'd go back to r10 if I could, but I can't find a way.

Edit Jan 19: I have found the underlying cause of this problem. At some point google introduced to the SDK a feature called "png crush". And PowerVR is not always happy loading those textures. See my other question here for more info and solution.

Community
  • 1
  • 1
weston
  • 54,145
  • 21
  • 145
  • 203

4 Answers4

3

Without source code, it is hard to tell what is really going on. Try debugging on emulators with different API levels and see if you can reproduce it.

If you can't get it reproduced, I suggest you take a look at ACRA and BugSense. Using those 3rd party crash reporting plugins is super easy and you can even report silent exceptions manually, too.

Kimi
  • 6,239
  • 5
  • 32
  • 49
  • 1
    Emulators are out of the question because is OpenGL 2.0. Thanks though, I have put out a version with bugsense now. But given my users don't even see a normal Force Close dialog, I am not hopeful that this will be able to catch it. – weston Dec 31 '11 at 13:01
  • ACRA is much more useable for custom reports and specifically reporting silent exceptions that do not force close the application. I'm not sure whether BugSense can catch those or not. – Kimi Dec 31 '11 at 13:10
  • Yeah that bugsense is not good, I tested with a exception in opengl thread, thing just froze. Seemed to only report from UI thread. Will look at ACRA. – weston Dec 31 '11 at 15:01
2

Are you using some native code? Because if there is a segment fault, it will print the stacktrace to logcat, but it won't create an Uncought Exception (so in this case plugins like ACRA are useless, even though I can recomment ACRA a lot)

Force
  • 6,312
  • 7
  • 54
  • 85
  • Interesting, what classifies as native code, I have OpenGl 2 code being called could this segment fault? – weston Jan 05 '12 at 12:11
  • Native code would be C-source compiled with the Android-NDK to use for your game. But if you ask what it is, you probably haven't used it ;-) – Force Jan 05 '12 at 13:16
1

It does happen to my applications as well, quite often during development-debug and it is usually due to the following problem.

  • The GPU goes in an out of memory status since there is too much memory allocated using VBOs. This usually depends on the fact not always the VBOs are deallocated correctly. When it does happen, in my humble experience, is like if the virtual machine hosting your application dies. Ufortunately it is evident that you cannot check the logcat of your users.

The problem is very variable since it depends on the GPU type and on the memory available to the GPU. For instance on my galaxy tab, it happens after (in terms of loaded levels and therefore VBOs) my basic Motorola Defy.

This creates a lot of troubles in the troubleshooting.

:)

Maurizio Benedetti
  • 3,557
  • 19
  • 26
  • Very interesting indeed! Looking into the devices that have the problem they are all droids and galaxy s devices and they all have a common/similar GPUs, the [PowerVR](http://en.wikipedia.org/wiki/PowerVR#Series_5) SGX 540 and SGX 530. I would greatly appreciate any advice and experience you have on VBOs and your galaxy tab (which I believe also has that GPU). Looking good for the +100 for you! – weston Jan 06 '12 at 18:25
0

There is only way to rewrite default exception behavior - UncaughtExceptionHandler. You can create your own class ExceptionHandler implements UncaughtExceptionHandler and do with exceptions whatever you want - send it to you remote server or smth else. To register it you should create Application class:

public class YourApplication extends Application {
@Override
public void onCreate() {
    super.onCreate();
    Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this.getApplicationContext()));
    }
}

and register this class in your manifest file

<application 
    android:name="your.package.name.YourApplication" 
    ... >
         ...
</application>
Jin35
  • 8,602
  • 3
  • 32
  • 52
  • Thanks, but I am faily certain there is no exception being thrown, or else the user would see force close message box. – weston Jan 05 '12 at 12:12