Missing resources and wrong OS linked

瀏覽次數:132 次
跳到第一則未讀訊息

Jeremy Wadsack

未讀,
2011年4月25日 晚上8:13:332011/4/25
收件者: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

未讀,
2011年4月26日 晚上7:29:382011/4/26
收件者: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

未讀,
2011年4月29日 凌晨1:10:532011/4/29
收件者: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.

回覆所有人
回覆作者
轉寄
0 則新訊息