title: Running Android tests (junit) in Android Studio does not work Exception in thread “main” java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
body: <p>When I run a Andriod test (junit) test in Android Studio I get the folowing errormessage.
  Exception in thread “main” java.lang.NoClassDefFoundError: junit/textui/ResultPrinter.</p>
  
  <p>I assume the error is because it cannot find the junit.jar file.
  When I follow below junit setup it does not fix the error:</p>
  
  <p><a href="http://www.tutorialspoint.com/junit/junit_environment_setup.htm" rel="nofollow">http://www.tutorialspoint.com/junit/junit_environment_setup.htm</a></p>
  
  <p>I cannot get above setup working. It still cannot find the junit classes.
  Any ideas how to fix the problem.</p>