Why cannot I import AndroidJUnit4 and ActivityTestRule into my unit test class?
问题 I'm having trouble importing some of the Android UI testing framework clases - I just can't figure out what is going wrong! This is my class: @RunWith(AndroidJUnit4.class) @LargeTest public class ExampleUnitTest { @Rule public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule(MainActivity.class); @Test public void listGoesOverTheFold() { onView(withText("Hello world!")).check(matches(isDisplayed())); } } But for some reason I get errors 'cannot find symbol ActivityTestRule'