Gradle Robolectric Resources NotFoundException in Testing

隐身守侯 提交于 2019-12-01 03:53:14

I had this same problem even with Robolectric v2.3-SNAPSHOT. Solved it by explicitly setting the manifest in the test file via the Config annotation, like

@Config(manifest = "src/main/AndroidManifest.xml")
@RunWith(RobolectricTestRunner.class)
public class MainActivityTest extends AndroidTestCase {
...
}
Jose M Lechon

At the end I managed to solve it moving to Robolectric v2.3-SNAPSHOT.

You can find this SNAPSHOT here oss.sonatype.org/index.html#nexus-search;quick~org.robolectric

The same Jake Wharton plugin works well with this Robolectric v2.3-SNAPSHOT.

Perhaps this information might help someone else.

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