連接庫JUnit
,當我乳寧的考驗,我有一個錯誤:錯誤JUnit版本3.8或更高版本的預期 - Android Studio中
!!! 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'}
只是猜測,但你的測試'擴展TestCase'? –
你有沒有檢查過這個 - http://stackoverflow.com/questions/30629314/android-studio-with-junit-4-12-junit-version-3-8-or-later-expected? – Oleksandr
也檢查出http://stackoverflow.com/q/2422378/95725 – NamshubWriter