Cordova. Failing building app on jenkins

Ask, and ye shall receive.
beetroot
Posts: 2
Joined: 15:59, 13 Jan 2016

Cordova. Failing building app on jenkins

Postby beetroot » 16:09, 13 Jan 2016

Hi,

I'm trying to set up a jenkins job in order to generate an apk using Cordova.
Locally everything works fine but on Jenkins, it fails. I've set up my environment in order to just build a hello.cordova app.

I've set up my ANDROID_HOME variable like that

ANDROID_HOME=/opt/android/android-sdk-linux
PATH=$PATH;$ANDROID_HOME/tools;$ANDROID_HOME/platform-tools;$ANDROID_HOME/build-tools/23.0.2

I'm executing these commands from the shell

Code: Select all

cordova create myApp

cd myApp

cordova platform add android@5.0.0

cordova prepare android
cordova compile android


the build fail saying :

Code: Select all

14:54:20 + cordova compile android
14:54:21 ERROR building one of the platforms: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
14:54:21 You may not have the required environment or OS to build this project
14:54:21 Error: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
14:54:21 Build step 'Execute shell' marked build as failure
14:54:21 [SSH] executing post build script:
14:54:21
14:54:21
14:54:21 Successfully triggered JIRA to update builds of this job
14:54:21 [BFA] Scanning build for known causes...
14:54:21 [BFA] No failure causes found
14:54:21 [BFA] Done. 0s
14:54:21 Finished: FAILURE


I don't know if it is about the not found SDKs or something else.

Thank you for your help :)

gokr
Posts: 13
Joined: 12:50, 02 Nov 2015

Re: Cordova. Failing building app on jenkins

Postby gokr » 22:49, 13 Jan 2016

Just a "shot from the hip" - shouldn't you use export for those env vars? Try adding export in front of both lines so its:

Code: Select all

export ANDROID_HOME=/opt/android/android-sdk-linux
export PATH=$PATH;$ANDROID_HOME/tools;$ANDROID_HOME/platform-tools;$ANDROID_HOME/build-tools/23.0.2


regards, Göran

beetroot
Posts: 2
Joined: 15:59, 13 Jan 2016

Re: Cordova. Failing building app on jenkins

Postby beetroot » 15:47, 14 Jan 2016

Hi,

Thanks for your answer but no at this level I am putting these path in the "Inject environment variables to the build process" of project configuratio in the jenkins job.

Any idea on what components of the sdk need to be in the path ?

Thanks


Return to “Questions and answers”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests