when I run the tests in robolectric 1.1 the following error occurs when inflate a layout file:
java.lang.RuntimeException: Could not find layout layout/home_layout
at com.xtremelabs.robolectric.res.ViewLoader.inflateView(ViewLoader.java:92)
at com.xtremelabs.robolectric.res.ViewLoader.inflateView(ViewLoader.java:82)
at com.xtremelabs.robolectric.res.ViewLoader.inflateView(ViewLoader.java:86)
Does anyone know why this error occurs? from what I saw, in version 1.1 of robolectric was no change in the way of loading layout files, it searches the folder layout/:
private ViewNode getViewNodeByLayoutName(String layoutName) {
if (layoutName.startsWith("layout/") && !qualifierSearchPath.isEmpty()) {
String rawLayoutName = layoutName.substring("layout/".length());
for (String location : qualifierSearchPath) {
ViewNode foundNode = viewNodesByLayoutName.get("layout-" + location + "/" + rawLayoutName);
if (foundNode != null) {
return foundNode;
}
}
}
return viewNodesByLayoutName.get(layoutName);
}
but if the layout file is in another directory (eg layout-normal-hdpi), this error will occur ..
Does anyone know any solution for this?