title: Android Studio doesn't import androidx testing classes properly
body: <p>I have been working on sample UIAutomator project. I have created new Testcases using AndroidX Testing libraries.</p>
  
  <p>I am able to build, run the test cases from the command line. But when I tried to open the app from Android Studio I can see most of the classes are not imported properly. For eg.,</p>
  
  <pre><code>import androidx.test.uiautomator.UiObject2;
  import org.junit.Before;
  </code></pre>
  
  <p>The above two imports are showing as not imported. Likewise lots of classes are showing the same error except android.content.Context, android.content.Intent, etc.,</p>
  
  <p>Can someone through some light on this. I am able to execute the testcases properly from the command line but not able to execute them properly from Android Studio.</p>
  
  <p>I have Restarted PC/Studio, cleared caches, still the problem exists.</p>
  
  <p>below is the dependency I have added in app/build.gradle.</p>
  
  <pre><code>androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
  androidTestImplementation 'androidx.test:core:1.0.0'
  androidTestImplementation 'androidx.test.ext:junit:1.0.0'
  androidTestImplementation 'androidx.test:runner:1.1.0'
  androidTestImplementation 'junit:junit:4.12'
  </code></pre>
  
  <p>Added the below code in gradle.properties</p>
  
  <pre><code>android.useAndroidX=true
  android.enableJetifier=true
  </code></pre>
  
  <p>I have pretty much followed the same what I have got from android-testing-master/ui/uiautomator sample code, not sure what I am missing.</p>