I recently upgraded the Android SDK on a Jenkins machine to rev15 with rev13 and I had to redo some of our custom build materials in build.xml to fit into the changes made to rev14. I worked it out on my workstation and tested it, expecting it to be peachy. Instead, the build fails with the following error:
-obfuscate: -dex: [dex] Converting compiled files and external libraries into /export/home/hudson/jobs/path/to/the/file/classes.dex... [dx] [dx] UNEXPECTED TOP-LEVEL EXCEPTION: [dx] java.util.zip.ZipException: error in opening zip file [dx] at java.util.zip.ZipFile.open(Native Method) [dx] at java.util.zip.ZipFile.<init>(ZipFile.java:127) [dx] at java.util.zip.ZipFile.<init>(ZipFile.java:143) [dx] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:206) [dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131) [dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109) [dx] at com.android.dx.command.dexer.Main.processOne(Main.java:418) [dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329) [dx] at com.android.dx.command.dexer.Main.run(Main.java:206) [dx] at com.android.dx.command.dexer.Main.main(Main.java:174) [dx] at com.android.dx.command.Main.main(Main.java:95) [dx] 1 error; aborting BUILD FAILED /opt/android-sdk-linux/tools/ant/build.xml:729: The following error occurred while executing this line: /opt/android-sdk-linux/tools/ant/build.xml:731: The following error occurred while executing this line: /opt/android-sdk-linux/tools/ant/build.xml:743: The following error occurred while executing this line: /opt/android-sdk-linux/tools/ant/build.xml:249: null returned: 1
I can successfully create a project by running ant as a Jenkins user directly in the Jenkins workspace directory with the same Android SDK, Ant and JDK that Jenkins uses. I even cut and paste the execution line from the Jenkins log to make sure all buttons and switches are set the same. So this is about how Jenkins starts building that problem.
I had Jenkins, which resets the environment as the shell exec step of the assembly, and I see that the LD_LIBRARY_PATH variable is set.
LD_LIBRARY_PATH=/u0/jdk1.6.0_29/jre/lib/i386/server:/u0/jdk1.6.0_29/jre/lib/i386:/u0/jdk1.6.0_29/jre/../lib/i386
I set this value in my terminal when starting the assembly from the shell, and it fails the same way as when Jenkins works. Ah ha!
The problem is that I cannot figure out how to save the LD_LIBRARY_PATH variable from installation, or point out what will not cause this problem. It is not installed in the Jenkins user environment, and I cannot find anything that could be a reference to it in the Jenkins configuration. The value it set changed when I installed the updated JDK and updated the JAVA value in /etc/defaults/jenkins , so it is clearly related, but unfortunately the behavior has not improved.
I have no ideas. Any help?
Argyle
source share