Monkey Test - Error with emulator and mediaplayer

407 views Asked by At

I'm running some monkey tests in a very simple android application (2 activities, a couple of buttons, edittexts, etc...) using Android emulator.

adb shell monkey -p my_package 5000

And I'm getting always this strange error:

java.lang.RuntimeException: Unable to create service com.android.music.MediaPlaybackService: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
//  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3172)
//  at android.app.ActivityThread.-wrap5(ActivityThread.java)
//  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
//  at android.os.Handler.dispatchMessage(Handler.java:102)
//  at android.os.Looper.loop(Looper.java:154)
//  at android.app.ActivityThread.main(ActivityThread.java:6077)
//  at java.lang.reflect.Method.invoke(Native Method)
//  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
//  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
// Caused by: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
//  at android.app.ContextImpl.checkMode(ContextImpl.java:2162)
//  at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:363)
//  at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:358)
//  at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:164)
//  at com.android.music.MediaPlaybackService.onCreate(MediaPlaybackService.java:338)
//  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3162)
//  ... 8 more
// 
** Monkey aborted due to error.

It's about MediaPlayer but this app is not using anything related to that.

Why is this error happening? How can I avoid it?

Thanks in advance!

0

There are 0 answers