Situation
I am using a VideoView which I show when I want to play a video. After playing the video I hide it again. So I do not recreate the VideoView each time.
Exception
Every once in a while the app crashes when I try to start playing a video (sometimes after I have already played several videos using the VideoView before).
I get the stacktrace you can find below. I have tried almost everything but without luck. Maybe you struggled with this issue as well or even know the reason?
02-23 15:10:52.362 22834-22890/com.app.example D/dalvikvm: GC_EXPLICIT freed 189K, 27% free 11296K/15368K, paused 0ms+0ms, total 10ms
02-23 15:10:52.422 22834-22890/com.app.example D/dalvikvm: GC_EXPLICIT freed 189K, 27% free 11296K/15368K, paused 0ms+0ms, total 10ms
02-23 15:12:19.832 22834-22890/com.app.example W/PGA: [22890] egl: eglDestroySurface (0x5583a7a0, 0x7956ad40)
02-23 15:12:19.832 22834-22890/com.app.example W/PGA: [22890] egl: eglDestroySurface (0x5583a7a0, 0x7956ad40) returned
02-23 15:12:19.872 22834-22843/com.app.example E/MediaPlayer: error (1, -2147483648)
02-23 15:12:20.182 22834-22834/com.app.example D/AndroidRuntime: Shutting down VM
02-23 15:12:20.182 22834-22834/com.app.example W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x64d77b20)
02-23 15:12:20.182 22834-22847/com.app.example W/AudioSystem: AudioFlinger server died!
02-23 15:12:20.182 22834-22847/com.app.example W/IMediaDeathNotifier: media server died
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example W/AudioSystem: AudioPolicyService server died!
02-23 15:12:20.322 22834-22834/com.app.example I/Process: Sending signal. PID: 22834 SIG: 9
02-23 15:12:20.322 22834-22834/com.app.example D/AndroidRuntime: procName from cmdline: com.app.example
02-23 15:12:20.322 22834-22834/com.app.example E/AndroidRuntime: in writeCrashedAppName, pkgName :com.app.example
02-23 15:12:20.322 22834-22834/com.app.example D/AndroidRuntime: file written successfully with content: com.app.example StringBuffer : ;com.app.example
02-23 15:12:20.322 22834-22834/com.app.example E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.example, PID: 22834
java.lang.RuntimeException: failure code: -32
at android.media.MediaPlayer.invoke(MediaPlayer.java:664)
at android.media.MediaPlayer.getInbandTrackInfo(MediaPlayer.java:1692)
at android.media.MediaPlayer.scanInternalSubtitleTracks(MediaPlayer.java:1851)
at android.media.MediaPlayer.access$600(MediaPlayer.java:529)
at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:2198)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)