Android Studio - with Junit 4.12 “!!! JUnit version 3.8 or later expected:”

前端 未结 14 1441
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-07 15:50

Tried out the suggestions on this post, but I still get the error:

!!! JUnit version 3.8 or later expected:

java.lang.RuntimeException: Stub!
    at junit.r         


        
14条回答
  •  臣服心动
    2021-01-07 16:39

    Just to add one more situation. I was having this error after updating Android Studio to 4.1 on a project using old AGP (3.3.2) and Gradle (4.10.2). What ended up solving the issue for me was removing the android.test.runner library from gradle dependencies, that is removing the following line from the app's module build.gradle:

    useLibrary 'android.test.runner'
    

    I probably got lucky to not actually need any of the classes provided by the library for unit or instrumented tests.

提交回复
热议问题