Android Jenkins Build - debug "target" does not exist in project error
I have installed Jenkins server along with Android SDK on a headless Linux build server. I am creating an android project via the typical "android create project ..." command.
After I "cd" into a new project, I can "ant clear debug" successfully as jenkins user on the command line. I am running this from the Jenkins workspace directory (.jenkins / workspace / <project name>):
# su jenkins
$ ant clean debug
.... successful ....
However, when Jenkins build is running I get "Debug" target does not exist in the "ProjectName" error of the project
I have set the sdk.dir variable to my Android SDK directory, so the command in Jenkins log works like this:
$ ant -Dsdk.dir=/opt/java/android clean debug
I set my permissions to 777 in the whole Android SDK folder:
# chmod -R 777 /usr/java/android/android-sdk
Am I at a loss for what else I might be missing? Why does the command run on the command line but doesn't work as a Jenkins job?
Thank!
source to share
After several days of frustration and surprise, it turns out that deleting the project and re-creating it with EXACT same settings fixed the problem. At the same time I created and deleted a few more jobs and sometimes they have the above mentioned error and sometimes they don't. Even with the same settings for the job (letter for letter), it works from time to time, while others don't. Sorry, I don't know how to fix this problem other than delete the Job, recreate it and try again!
Good luck!
source to share
I have the same problem too. However, after breaking my head for a while, I was able to fix the problem. Therefore, if you want to run ant target on the command line, you must use "ant target name" (eg ant debug). But to run the same jenkin target, you should only use the target name without ant (like debug).
I don’t know why this is so. But this solved the problem for me.
source to share