1

I've finished developing a game, but it's very annoying that sometimes (yes, only sometimes!) when I open it, it fails, and I can see in logcat this error: java.io.IOException: Prepare failed.: status=0x80000000.

It's very weird because it's a local file (2MB mp3 file), and I don't know why it shows a IOException. And only sometimes, not always...

EDIT: It seems that is related with proguard, because it only happens with release version...

Sergio Viudes
  • 2,714
  • 5
  • 26
  • 44

2 Answers2

5

I finally solved it.

It happened because my MediaPlayer variables were static, so when I restart the app I was creating more MediaPlayers without releasing previous ones, and there is a limit of 8 (at least in Android 2.3.6, where I tested it). Calling mediaPlayer.release() (if mediaPlayer != null, of course) it's solved.

Hope it helps someone.

Sergio Viudes
  • 2,714
  • 5
  • 26
  • 44
1

I have get the same issue here. (may 2021)

And when I find on internet I see some answer about this thing. They said that when mediaPlayer prepare datasource and it can not read the end char so it return IOException Prepare failed. So the way they resolved that is convert to new file with difference type (wav, mp4, mp3,...). Hope can help anyone on this issue.

JackDao
  • 433
  • 4
  • 10