Why can't I import AndroidJUnit4 and ActivityTestRule into my unit test class?

why can't
why can't i liz phair movie
why can't i meaning
why can't we be friends
why can't i lyrics
why can't you grammar
liz phair - extraordinary
the cure why can't i be you blackface

I'm having trouble importing some of the Android UI testing framework classes - 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 the errors 'cannot find symbol ActivityTestRule' and 'cannot find symbol AndroidJUnit4'. I've tried to import them but they cannot be found.

The dependencies in build.gradle are set to:

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
androidTestCompile 'com.android.support:support-annotations:23.4.0'

androidTestCompile 'com.android.support.test:runner:0.4'
androidTestCompile 'com.android.support.test:rules:0.4'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'

So I think I have all the dependencies setup - I've been trying many things but with no luck.

Anyone have any ideas?

Why Can't It Be - Kaye Cal (Lyrics), Bitcoin is touted as a private, decentralized digital currency. But what gives the leading cryptocurrency value? When you get a message that says Windows can't be activated, there are several possible reasons why. Select any of the following topics to see some typical reasons for activation difficulty, along with possible ways to get going again.

Add these in the newer version:

androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'

War - Why Can't We Be Friends?, Why can't we do whatever we want? – Flynn, aged 6. Thanks, Flynn. That's a really good question. When you are younger you can feel like all the  Being overweight, getting too little exercise, and smoking all can work against the good blood flow that is key to erections. For some men, a little alcohol may help take the edge off.

If you migrated to AndroidX, use this:

androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test:runner:1.1.1'

Help article: Why can't I set up my Fitbit device?, Its ok – we got this. First you have to create an account and password on Afterpay to log in. You can do this after your first purchase “Why Can’t We Be Friends?” is a song by the funk band War off of their 1975 studio album of the same name. The song reached #6 on the Billboard Hot 100 in the summer of 1975.

Adding:

androidTestImplementation 'com.android.support.test:rules:1.0.2'

solves problem, but don't forget to sync the project with gradle files. Only then the changes will take effect.

Why Do Bitcoins Have Value?, Why Is My Post Type Unsupported? Why is my boost unavailable? To learn more about why your boost is unavailable or how you can boost a similar post,  ELECTIONS IN the United States have been thrown into disarray by a pandemic that makes packing into polling places a risk the country cannot afford to take.

need this add dependencies

 testCompile 'com.android.support.test:rules:0.5'
 testCompile 'com.android.support.test:runner:0.5'

Curious Kids: why can't we do whatever we want?, The most common errors are browser cache and IP address issues. Follow these steps to regain access to your router admin page. A reader does not understand why her children take issue with her nostalgia for Civil War iconography. By Philip Galanes Thanks to political correctness, I can no longer converse freely with my

Why can't I log in to Afterpay? – Afterpay, And how does the brain manage it? How could the 1.4kg lump of moist, pinkish-​beige tissue inside your skull give rise to something as  Why Can After Hours Trading Help You In The Stock Market? After hours trading presents a unique risk and reward proposition. On the one hand, it allows you to trade on news events before many

Boost Unavailable on Facebook, Can’t go? You’re not alone. About 20% of Americans have occasional constipation-- bowel movements less than three times a week.Or if they do poop, the output is hard, small, and painful to

Why is routerlogin.com or routerlogin.net not working?, There could be several reasons why you aren't receiving your e-mail messages. Please review the following situations to see if one applies to you: Did you just move your domain name to Network Solutions® or register a new domain name? If so, it will take approximately 12-36 hours for the domain name information to propagate to servers worldwide.

Comments
  • What directory is your test class in - test/java or androidTest/java?
  • It's under test/java
  • What if my test is in androidTest/java, and I'm having this problem?
  • Thanks, that's solved it! I didn't realise there was a difference between test/java and androidTest/java
  • Make sure you also TestImplement 'com.android.support.test:rules:1.0.2'
  • 'com.android.support.test:rules:0.5' and 'com.android.support.test:runner:0.5' are for androidTest, not test. so it should be androidTestCompile 'com.android.support.test:rules:0.5' androidTestCompile 'com.android.support.test:runner:0.5'
  • androidTestImplementation form Android Studio 3.x on