Android maven build fail in Hudson

87 views
Skip to first unread message

Henrik

unread,
Oct 28, 2010, 5:55:35 AM10/28/10
to Maven Android Developers
Hello

I have an android app which i am building with maven on the command
line. It works fine. I want to do this in hudson now. However it fails
evry time. i have compared the logs from the command line with the
once from hudson and there is a small diference, apart from the fails
in the hudson log. It seems like [android:dex] is not run in hudson.
Can someone explain this. I use the same pom.xml and settings.xml.
What else can create the difference?

--- Running from Hudson ---
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[HUDSON] Recording test results
[INFO] [android:apk {execution: default-apk}]
[INFO] Copying local resource files to combined resource directory.
[INFO] /home/emprove/android-sdk-linux_x86/platforms/android-8/tools/
aapt [package, -f, -M, /var/lib/hudson/jobs/LinkonAndroid/workspace/
trunk/AndroidManifest.xml, -S, /var/lib/hudson/jobs/LinkonAndroid/
workspace/trunk/target/generated-sources/combined-resources/res, -A, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/assets, -I, /home/
emprove/android-sdk-linux_x86/platforms/android-8/android.jar, -F, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/
LinkonApplication-0.0.1.ap_]
[INFO] /home/emprove/android-sdk-linux_x86/tools/apkbuilder [/var/lib/
hudson/jobs/LinkonAndroid/workspace/trunk/target/
LinkonApplication-0.0.1.apk, -z, /var/lib/hudson/jobs/LinkonAndroid/
workspace/trunk/target/LinkonApplication-0.0.1.ap_, -f, /var/lib/
hudson/jobs/LinkonAndroid/workspace/trunk/target/classes.dex, -rf, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/classes]
[INFO]
[INFO] THIS TOOL IS DEPRECATED. See --help for more information.
[INFO]
[INFO] /var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/
classes.dex does not exist

--- Running comand line ---
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [android:dex {execution: default-dex}]
[INFO] /home/emprove/android-sdk-linux_x86/platforms/android-8/tools/
dx [--dex, --output=/home/emprove/test-linkon/Linkon/trunk/Android/
trunk/target/classes.dex, /home/emprove/test-linkon/Linkon/trunk/
Android/trunk/target/android-classes]
[INFO] [android:apk {execution: default-apk}]
[INFO] Copying local resource files to combined resource directory.
[INFO] /home/emprove/android-sdk-linux_x86/platforms/android-8/tools/
aapt [package, -f, -M, /home/emprove/test-linkon/Linkon/trunk/Android/
trunk/AndroidManifest.xml, -S, /home/emprove/test-linkon/Linkon/trunk/
Android/trunk/target/generated-sources/combined-resources/res, -A, /
home/emprove/test-linkon/Linkon/trunk/Android/trunk/assets, -I, /home/
emprove/android-sdk-linux_x86/platforms/android-8/android.jar, -F, /
home/emprove/test-linkon/Linkon/trunk/Android/trunk/target/
LinkonApplication-0.0.1.ap_]
[INFO] /home/emprove/android-sdk-linux_x86/tools/apkbuilder [/home/
emprove/test-linkon/Linkon/trunk/Android/trunk/target/
LinkonApplication-0.0.1.apk, -z, /home/emprove/test-linkon/Linkon/
trunk/Android/trunk/target/LinkonApplication-0.0.1.ap_, -f, /home/
emprove/test-linkon/Linkon/trunk/Android/trunk/target/classes.dex, -
rf, /home/emprove/test-linkon/Linkon/trunk/Android/trunk/target/
classes]
[INFO]
[INFO] THIS TOOL IS DEPRECATED. See --help for more information.
[INFO]
[INFO] [android:internal-pre-integration-test {execution: default-
internal-pre-integration-test}]

Thank you

Manfred Moser

unread,
Oct 28, 2010, 7:34:39 PM10/28/10
to maven-androi...@googlegroups.com
Can you run it on the commandline on the same machine Hudson is running
with the same commands you use in Hudson?

> --
> You received this message because you are subscribed to the Google Groups
> "Maven Android Developers" group.
> To post to this group, send email to
> maven-androi...@googlegroups.com.
> To unsubscribe from this group, send email to
> maven-android-deve...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/maven-android-developers?hl=en.
>

Henrik Gerdtsson

unread,
Oct 29, 2010, 4:13:42 AM10/29/10
to Maven Android Developers
Yes I tried that and I stil have the same problem. However after
running from the command line the hudson build oK since the
classes.dex was created from the command line.

I will try it again. First mvn clean, then run command line, clean
again and finally try with hudson.

Should I post the full logs or just the part that differ?

Thank you

Henrik Gerdtsson

unread,
Oct 29, 2010, 4:42:55 AM10/29/10
to Maven Android Developers
It has been done. Command line works Hudson fails. Same maven command
and same user. I am baffeled.

--- From Hudson ---
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[HUDSON] Recording test results
[INFO] [android:apk {execution: default-apk}]
[INFO] Copying local resource files to combined resource directory.
[INFO] /home/emprove/android-sdk-linux_x86/platforms/android-8/tools/
aapt [package, -f, -M, /var/lib/hudson/jobs/LinkonAndroid/workspace/
trunk/AndroidManifest.xml, -S, /var/lib/hudson/jobs/LinkonAndroid/
workspace/trunk/target/generated-sources/combined-resources/res, -A, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/assets, -I, /home/
emprove/android-sdk-linux_x86/platforms/android-8/android.jar, -F, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/
LinkonApplication-0.0.1.ap_]
[INFO] /home/emprove/android-sdk-linux_x86/tools/apkbuilder [/var/lib/
hudson/jobs/LinkonAndroid/workspace/trunk/target/
LinkonApplication-0.0.1.apk, -z, /var/lib/hudson/jobs/LinkonAndroid/
workspace/trunk/target/LinkonApplication-0.0.1.ap_, -f, /var/lib/
hudson/jobs/LinkonAndroid/workspace/trunk/target/classes.dex, -rf, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/classes]
[INFO]
[INFO] THIS TOOL IS DEPRECATED. See --help for more information.
[INFO]
[INFO] /var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/
classes.dex does not exist
--- End from Hudson ---
--- From command line ---
[INFO] No tests to run.
[INFO] [android:dex {execution: default-dex}]
[INFO] /home/emprove/android-sdk-linux_x86/platforms/android-8/tools/
dx [--dex, --output=/var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/
target/classes.dex, /var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/
target/android-classes]
[INFO] [android:apk {execution: default-apk}]
[INFO] Copying local resource files to combined resource directory.
[INFO] /home/emprove/android-sdk-linux_x86/platforms/android-8/tools/
aapt [package, -f, -M, /var/lib/hudson/jobs/LinkonAndroid/workspace/
trunk/AndroidManifest.xml, -S, /var/lib/hudson/jobs/LinkonAndroid/
workspace/trunk/target/generated-sources/combined-resources/res, -A, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/assets, -I, /home/
emprove/android-sdk-linux_x86/platforms/android-8/android.jar, -F, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/
LinkonApplication-0.0.1.ap_]
[INFO] /home/emprove/android-sdk-linux_x86/tools/apkbuilder [/var/lib/
hudson/jobs/LinkonAndroid/workspace/trunk/target/
LinkonApplication-0.0.1.apk, -z, /var/lib/hudson/jobs/LinkonAndroid/
workspace/trunk/target/LinkonApplication-0.0.1.ap_, -f, /var/lib/
hudson/jobs/LinkonAndroid/workspace/trunk/target/classes.dex, -rf, /
var/lib/hudson/jobs/LinkonAndroid/workspace/trunk/target/classes]
[INFO]
[INFO] THIS TOOL IS DEPRECATED. See --help for more information.
[INFO]
[INFO] [android:internal-pre-integration-test {execution: default-
internal-pre-integration-test}]
--- End from command line ---

For some reason when using Hudson the [android:dex] is not run.

Thank you

Manfred Moser

unread,
Oct 29, 2010, 11:28:40 AM10/29/10
to maven-androi...@googlegroups.com
Are you sure you are running the same commands from Hudson and on the
command line?

What about environment variables like MAVEN_HOME, ANDROID_HOME?

What about user access rights for the hudson user?

What about versions of Maven and so on?

Something must be different that causes it..

manfred

Pieter

unread,
Nov 8, 2010, 10:47:14 AM11/8/10
to Maven Android Developers
I have experienced the exact same problem. The only solution I
eventually found was to explicitly list all goals in order:
clean android:generate-sources compiler:compile resources:resources
jar:jar android:unpack android:dex install
(entered in the "Goals and options" entry in the Hudson job
configuration)
This forces the dex phase to be run.

Henrik Gerdtsson

unread,
Nov 9, 2010, 6:30:04 AM11/9/10
to Maven Android Developers
I have looked and I am not able to find any differences.
It is the same version of Maven.
JAVA_HOME is the same
User is hudson in both cases.
ANDROID_HOME in the command line is the same as Android SDK root in
hudson
I am not able to find what is differing.

I tried Pieters fix and it works. Thank you Pieter. You made my day.

Thank you for your time and effort.
Reply all
Reply to author
Forward
0 new messages