Roboletric 4.0.1 keeps throwing Resources$NotFoundException on buildActivity

柔情痞子 提交于 2019-12-07 11:31:24

Robolectric can't find your app's resources.

Add this to your build.gradle:

android {
    testOptions {
        unitTests.includeAndroidResources = true
    }
}

Add this to your gradle.properties (not necessary with Android Studio 3.3+):

android.enableUnitTestBinaryResources=true

I was having this issue while using Robolectric 4.2. Upgrading to 4.2.1 fixed the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!