6

I'm letting monkey run on my app (via android emulator) using the following instruction:

Monkey -p <packagename> -v 5000

I am getting the following errors:

01-28 11:45:55.392: ERROR/MediaPlayerService(34):   error: -2
01-28 11:45:55.392: ERROR/MediaPlayer(58): Unable to to create media player
01-28 11:45:58.783: ERROR/MediaPlayerService(34):   error: -2
01-28 11:45:58.783: ERROR/MediaPlayer(58): Unable to to create media player
01-28 11:46:13.742: ERROR/MediaPlayerService(34):   error: -2
01-28 11:46:13.752: ERROR/MediaPlayer(58): Unable to to create media player

This happens over and over again every few seconds and is the only error that occurs. This is odd because my app doesn't touch any media player functionality at all. It is a simple note/to-do app. Any insight into what monkey is touching that's causing the error and what I could do to prevent it?

Or can this be safely ignored?

Thanks!

EDIT: I think I found the source of my issue. Apparently monkey managed to put my keyboard into some sort of Asian language. And whenever the bottom left key (two Asian characters) is pressed in the soft keyboard image below. I receive the mediaplayer error. Does anyone know what this key does?? WHY MONKEY! WHY!?!?

Donut
  • 110,061
  • 20
  • 134
  • 146
Will Tate
  • 33,439
  • 9
  • 77
  • 71
  • No, that's why this is weird to me. I don't touch anything sound related. I'm going to run it again with increased verbosity now. – Will Tate Jan 28 '11 at 17:12
  • 1
    Actually, whenever I run monkey on my app, my media player starts to play and change songs. Very strange. My app has none of this functionality. – Ryan R Jun 19 '11 at 15:27
  • Sorry for the odd one out, but what does 'Monkey' here refer to? Just curious. – Srujan Barai Nov 03 '15 at 07:06
  • 1
    @SrujanBarai Monkey is a testing application for stress testing your App. Its like handing the phone to a monkey and letting them flip it around a bunch and bang on the keyboard (http://developer.android.com/tools/help/monkey.html) – Will Tate Nov 03 '15 at 14:35

1 Answers1

1

It could be trying to get into voice record mode which might fail in the emulator due to the lack of microphone input. Another thought is it's hitting the volume keys which your emulator can't handle for some odd reason.

What I always did was limit the monkey to what I was wanting to test. Per the Monkey doc page you can set --pct-syskeys and --pct-anyevent to 0 and see if that fixes it.

Andrew White
  • 52,720
  • 19
  • 113
  • 137
  • Thanks for the answer Andrew. I tried this to no avail :-\. But you got me thinking and I even disabled the audible touch tones and still nothing... – Will Tate Feb 01 '11 at 04:21
  • I tried on an Android 1.6 emulator instead of 2.2 and I'm not getting the error. I'm chalking it up to some OS wackiness unrelated to me app (this is totally gonna bite me in the ass, i know it). – Will Tate Feb 01 '11 at 04:49
  • 1
    pct-syskeys may have worked at some point, but it doesn't work on 4.4.2. The flag is accepted but the monkey still manipulates the volume (takes screenshots, too). –  Apr 02 '14 at 20:16