0

我正在尝试为 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)
4

1 回答 1

0

我会说这是https://github.com/robolectric/robolectric/issues/346。您使用的是哪个版本的 Robolectric?我想这只是在 Robolectric 2 中修复过的......

于 2013-08-26T12:46:17.457 回答