after a lot of tutorials regarding jenkins and android I still got stuck in having an error free build.
I did follow these tutorials:
The only difference to my setup is that I'm not checking out from a repository.
I have the code imported in the job itself, so in my "jobs" directory I do have a workspace with 2 projects (normal android and androidUnitTest project).
When trying to build I got this log:
[getbuildtools] Using latest Build Tools: 18.0.1
[echo] Resolving Build Target for MainActivity...
[gettarget] Project Target: Android 4.0
[gettarget] API level: 14
[echo] Creating output directories if needed...
[echo] Resolving Dependencies for MainActivity...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency] API<=15: Adding annotations.jar to the classpath.
[dependency] WARNING: unable to write jarlist cache file /Users/Shared/Jenkins/Home/jobs/Jenkins4AndroidTest/workspace/XJenkins/bin/jarlist.cache
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.'
/Users/Shared/android-sdks/tools/ant/build.xml:644: java.io.FileNotFoundException: /Users/Shared/Jenkins/Home/jobs/Jenkins4AndroidTest/workspace/XJenkins/bin/AndroidManifest.xml (Permission denied)
at java.io.FileOutputStream.open(Native Method)
/Users/Shared/android-sdks/tools/ant/build.xml:392: Problem: failed to create task or type checkenv
It seems to me a problem of ownership of the source.
Go to :
and perform and :
You should see something like that :
-rw-r--r-- 1 jenkins jenkins AndroidManifest.xml
If not, give the right to jenkins to it with chown command. I will personnaly do it on all directory
sudo chown -R jenkins:jenkins /Users/Shared/Jenkins
This command will give ownership of ALL CONTENT within Jenkins directory to Jenkins User.
BE CAREFUL : This is assuming that Jenkins is launched as a service with User Jenkins. If you launch jenkins as a webapp on tomcat7 for instance, Jenkins user will be tomcat7 and you shall grand tomcat7 with ownership