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

前端 未结 14 1612
爱一瞬间的悲伤
爱一瞬间的悲伤 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

    This is apparently an Android Studio 4.1 issue. There's an open ticket for that already: https://issuetracker.google.com/issues/170328018

    What really solved the issue for me was reinstalling the Android 11 (API 30) SDK, according to the bug ticket above:

    "...there was an issue with API 30 mock jar that was built incorrectly. Can you open Android Studio SDK Manager and try uninstalling the R SDK or any Android SDK Platform 30 please? The Gradle build will auto install it when you try to rebuild after you delete the R SDK."

提交回复
热议问题