Robolectric 2.1 and Eclipse

﹥>﹥吖頭↗ 提交于 2019-11-29 07:24:20

I kinda solved my issue, where I can at least run my tests to a point which makes some sense to me. In Robolectric 2.0 they allow you to specify the path to your AndroidManifest file by creating a Config.properties file in your test project.

Try these two steps and see if they work for you:

  1. Create a nodescript file (File > New > File) called 'org.robolectric.Config.properties' at your test's src directory.
  2. In the org.robolectric.Config.properties file add the line

    manifest:[relative path your AndroidManifest.xml]

I had to mess with the relative path a bit (kept adding/removing ../'s), but this got it to correctly find my AndroidManifest file.

You can find more info at this github issue or their configuring robolectric blog post. Both of which I found to not be straight forward enough.

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