我正在尝试为Android应用程序编写robolectric测试。当我试图阅读cofig时,我收到以下错误。
Caused by: java.lang.IllegalArgumentException: Got resource name bool/config_enable from id 2131427329 (0x7f0b0001), but found no resource by that name
at com.xtremelabs.robolectric.res.BoolResourceLoader.getValue(BoolResourceLoader.java:27)
at com.xtremelabs.robolectric.res.ResourceLoader.getBooleanValue(ResourceLoader.java:462)
at com.xtremelabs.robolectric.shadows.ShadowResources.getBoolean(ShadowResources.java:193)
at android.content.res.Resources.getBoolean(Resources.java)
答案 0 :(得分:0)
我说这是https://github.com/robolectric/robolectric/issues/346。您使用的是哪个版本的Robolectric?我想这只是在Robolectric 2中得到修复......