更新时间:2023-02-16 23:28:25
在Android Studio中运行Robolectric测试的唯一解决方法是更改测试任务的JRE.
The only workaround to run Robolectric test in the Android Studio is to change JRE for the test task.
选择IDE菜单,运行->编辑配置,然后将选项从图片更改为JDK9的位置:
Select IDE menu Run -> Edit Configuration and then change the option from the picture to the location of JDK9: