Missing resources and wrong OS linked

132 views
Skip to first unread message

Jeremy Wadsack

unread,
Apr 25, 2011, 8:13:33 PM4/25/11
to maven-androi...@googlegroups.com
This is an odd problem and I'm not really sure where to start looking except that the maven plugin seems to, for some reason, be trying to collect the wrong build data.

My dependencies, right now, include Android OS 2.3.3:

        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>2.3.3</version>
            <scope>provided</scope>
        </dependency>

And the same version in my plugin configuration:

            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>maven-android-plugin</artifactId>
                <version>2.8.3</version>
                <configuration>
                    <sdk>
                        <!-- platform or api level (api level 8 = platform 2.2)-->
                        <platform>2.3.3</platform>
                    </sdk>
                </configuration>
                <extensions>true</extensions>
            </plugin>

However, when I try to run my tests, I get an error about not finding resource for API level 9 which is 2.3.1, not 2.3.3.

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.077 sec <<< FAILURE!
java.lang.RuntimeException: java.lang.RuntimeException: no such directory /platforms/android-9/data/res/values
        at com.xtremelabs.robolectric.res.ResourceLoader.init(ResourceLoader.java:93)
        at com.xtremelabs.robolectric.res.ResourceLoader.inflateView(ResourceLoader.java:261)
        at com.xtremelabs.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:43)
        at com.xtremelabs.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:48)
        at android.view.LayoutInflater.inflate(LayoutInflater.java)
        at com.xtremelabs.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:73)
        at android.app.Activity.setContentView(Activity.java)
        at roboguice.activity.RoboActivity.setContentView(RoboActivity.java:81)

Note that this does run on the build server, using the same code. Also this runs just fine when run through IntelliJ IDEA. So it seems like there must be a configuration problem for maven or maven-android. 

Can someone give me a pointer of where to start looking?

--
Jeremy Wadsack

Jeremy Wadsack

unread,
Apr 26, 2011, 7:29:38 PM4/26/11
to maven-androi...@googlegroups.com
Ok, I seem to have resolved this by settting ANDROID_HOME as an environment variable. Note that I already set the Android SDk location in ~/.m2/settings.xml but that doesn't seem to have worked for this part of the process. 

Perhaps someone more familiar with the code can suggest whether that's a maven-android-plugin issue or a roboguice issue.

--
Jeremy Wadsack

Manfred Moser

unread,
Apr 29, 2011, 1:10:53 AM4/29/11
to maven-androi...@googlegroups.com
Try 10 for platform config...

--
Manfred Moser
http://www.mosabuam.com
skype mosabua, twitter.com/mosabua
http://www.linkedin.com/in/manfredmoser

> finding resource for API *level 9* which is 2.3.1, not 2.3.3.

Reply all
Reply to author
Forward
0 new messages