In roboelectric, when you write your test class, you declare the @RunWith annotation, which has RobolectricGradleTestRunner and RobolectricTestRunner.class. What is the difference and which one should we use? Why, firstly, 2. If I use RobolectricTestRunner, then it does not work for me, this indicates some strange error, for example:
"java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity."
However, this seems to disappear if I use RobolectricGradleTestRunner.
source share