Search code examples
androidandroid-5.0-lollipoprobotium

Android Lollipop, Robotium script not working. Getting Service Intent must be explicit act=com.bitbar.testdroid.monitor.ScreenshotService


I just upgraded my phone to Android Lollipop and now my Robotium scripts don't work on it.

It throws the following exception when I call:

solo = new ExtSolo(getInstrumentation(), getActivity(), this.getClass().getCanonicalName(), getName());



java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.bitbar.testdroid.monitor.ScreenshotService }
at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:2052)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:2160)
at android.app.ContextImpl.bindService(ContextImpl.java:2138)
at com.bitbar.recorder.extensions.ScreenshotUtils.<init>(ScreenshotUtils.java:50)
at com.bitbar.recorder.extensions.ExtSolo.<init>(ExtSolo.java:152)
at ie.eureka.moveit4.test.activity.SuperTest.setUp(SuperTest.java:176)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1873)

Any suggestions?


Solution

  • In this class "com.bitbar.recorder.extensions.ScreenshotUtils", the com.bitbar.testdroid.monitor.ScreenshotService class is called implicitly. You need now to call explicitly the service by class name and not by filters in your Intent.