当前位置: 首页 > 知识库问答 >
问题:

错误,应为JUnit 3.8或更高版本-Android Studio

祖麻雀
2023-03-14

连接库junit时,运行测试时出现错误:

!!! JUnit version 3.8 or later expected:

java.lang.RuntimeException: Stub! at
    junit.runner.BaseTestRunner.(BaseTestRunner.java:5) at
    junit.textui.TestRunner.(TestRunner.java:54) at
    junit.textui.TestRunner.(TestRunner.java:48) at
    junit.textui.TestRunner.(TestRunner.java:41) at
    com.intellij.rt.execution.junit.JUnitStarter.junitVersionChecks(JUnitStarter.java:191)
    at
    com.intellij.rt.execution.junit.JUnitStarter.canWorkWithJUnitVersion(JUnitStarter.java:174)
    at
    com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497) at
    com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

格雷德尔:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
testCompile 'junit:junit:4.11'}

共有1个答案

暨弘懿
2023-03-14

嗯,你为什么不试试

testCompile 'junit:junit:3.8'

 类似资料:
  • 我正在做Android项目(在Android Studio中),里面有一个纯Java的SDK。 所以我想要的是从JUnit4做测试。

  • 我尝试了这篇文章中的建议,但我还是得到了错误: 不知道从这里做什么。尝试重新组织Junit依赖项的顺序。不走运,还有人知道这个问题吗? Android Studio v.1.2.1.1

  • 问题内容: 我正在尝试使用 pycharm(3.3) 通过以下代码 访问我的 Oracle SQL(11.2.0) ,但以下详细信息出现错误。 使用的代码: 收到错误 问题答案: 我遇到了一个与您非常相似的问题。我能够通过使用其他连接方法来解决它: 有关更多信息,请参见http://cx-oracle.readthedocs.io/en/latest/module.html

  • 我在androidstudio中导入一个cordova项目,并得到一个错误:找不到已安装的构建工具。请安装Android构建工具版本19.1.0或更高版本。 我已经安装了所有的构建工具。甚至我已经通过了这篇文章,但不能解决错误。 链接1链接2 我在操作系统上看到了很多问题,但没有得到任何解决方案。 我们将不胜感激。谢谢

  • 根据我的头衔。几个月来,我一直在愉快地使用Eclipse,但现在它出现了问题(我认为这是因为我在SDK中添加了API 19)。 无论如何,我删除了SDK和Eclipse,并重新安装了它们。它们位于C:\Program Files(x86)中名为development的文件夹中,与Java文件相同。 所以我加载了Eclipse并且没有错误,所以我想我会更新SDK:Android SDK Tools

  • 将和升级到和或更高版本时,我们遇到一个问题 java.lang.InternalError:无法在org.bouncycastle.jcajce.provider.drbg.drbg$urlseededsecurerandom$1上打开随机源。在org.bouncycastle.jcajce.provider.drbg.drbg$urlseededsecurerandom$1上运行(drbg.ja