Android Studio SDK JUnit tests not working

时间:2015-05-24 22:07:37

标签: android junit sdk

I'm fairly new to android studio and I'm trying to do some JUnit tests on an app that I'm making. But I keep getting this error:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:testDebug'.
> Test filtering is not supported for given version of JUnit. Please upgrade JUnit version to at least 4.6.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 11.791 secs
Test filtering is not supported for given version of JUnit. Please upgrade JUnit version to at least 4.6.

How can I fix this?

1 个答案:

答案 0 :(得分:0)

按照以下步骤 -

  1. 转到菜单RUN->运行配置
  2. 按照以下截图
  3. 添加测试运行器
  4. 使用" MyTest"跑步者 enter image description here