1

My game starts off by showing an intro video, after which it loads the main menu and plays a song. Below is the creation and execution of the song.

    try
    {System.out.println("?????????? create and play");
        menuSong = MediaPlayer.create(this, R.raw.kindergarten_ska);
        menuSong.setLooping(true);
        menuSong.start();
    }
    catch (Exception e)
    {
        System.out.println("??????????? caught");
    }

The error A/libc(1898): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) is thrown during MediaPlayer.create(). The annoying part is that instead of catching the error, the app goes back to the intro! Which then ends up in an infinite loop. Which means there's nothing (As far as I can see) I can do to handle the error.

Also, this error occurs when trying to run from my 4.0.4 tablet. It works just fine on my 2.2.1 phone.

An error like this would lead me to believe that something is null, but the only thing possible in this case is the R value. It's an ogg file so I don't see why it wouldn't work on the tablet.

Also interesting is that this is the only MediaPlayer usage where it crashes. MediaPlayer works just fine elsewhere in the code.

Jesse Jashinsky
  • 10,313
  • 6
  • 38
  • 63
  • Don't just use a `catch` block to print text - at the very least use `e.printStackTrace()` so you can see what the exception is. Also, don't use `System.out.println(...)` in Android - use the `Log` class instead. – Squonk Apr 13 '13 at 19:09
  • This is just quick testing code, not something I'd use in production. My point was to show that the try catch doesn't help. – Jesse Jashinsky Apr 13 '13 at 19:11
  • I'm not sure if it will help but see the answer from commonsware in this post. http://stackoverflow.com/questions/14023291/fatal-signal-11-sigsegv-at-0x00000000-code-1-phonegap - his answer suggests it's either a bug in some 3rd party library, a custom ROM or Android itself. Also - are you using Unity? There are a few results of a Google search which suggest some versions of Unity and some versions of Android can cause that error. It seems it's in native code which is why the `catch` block isn't catching anything. – Squonk Apr 13 '13 at 19:30
  • I am not using Unity. Also I know the same error occurred in an emulator that a friend tested, but I can't at this time reproduce it. – Jesse Jashinsky Apr 13 '13 at 19:59
  • please test running the media file on the tablet's mediaplayer and see if it works – Mr.Me May 09 '13 at 18:04
  • @Mr.Me Yes, it works from the tablet's mediaplayer. – Jesse Jashinsky Jun 02 '13 at 03:03

0 Answers0