Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Robolectric 1.1 fails to load layout file when the file is not in the directory res/layout/
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robson R Ferreira  
View profile  
 More options Nov 8 2012, 3:10 pm
From: Robson R Ferreira <robso...@gmail.com>
Date: Thu, 8 Nov 2012 12:10:45 -0800 (PST)
Local: Thurs, Nov 8 2012 3:10 pm
Subject: Robolectric 1.1 fails to load layout file when the file is not in the directory res/layout/

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?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »