junit版本 Android,錯誤JUnit版本3.8或更高版本的預期 - Android Studio中

博客围绕Android开发中JUnit版本问题展开,给出了报错信息,如期望JUnit版本3.8或更高却出现异常。还展示了摇篮配置中JUnit的依赖设置,同时提供了相关问题的参考链接,帮助解决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'}

+0

只是猜測,但你的測試'擴展TestCase'? –

+0

你有沒有檢查過這個 - http://stackoverflow.com/questions/30629314/android-studio-with-junit-4-12-junit-version-3-8-or-later-expected? –

+0

也檢查出http://stackoverflow.com/q/2422378/95725 –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值