I am trying to set up a plugin for an Android emulator for Jenkins and it is hard for me to find why the plugin can't find the Android SDK.
First, after cloning a project, Jenkins always displays:
[android] No Android SDK found; let install it automatically... [android] Going to install required Android SDK components... [android] Installing the 'platform-tool,tool' SDK component(s)... $ /var/lib/jenkins/tools/android-sdk/tools/android update sdk -u -a -t platform-tool,tool
After that, it fails because the plugin probably does not know how to respond to the license agreement.
Do you accept the license 'android-sdk-license-bcbbd656' [y/n]: Unknown response ''. Do you accept the license 'android-sdk-license-bcbbd656' [y/n]: Unknown response ''. Max number of retries exceeded. Rejecting 'android-sdk-license-bcbbd656'
So, I just replicate the command myself and installed everything. The result remains unchanged, Android SDK not found. I tried chown and chmod 755 to make sure Jenkins could access it, and again it failed.
I checked in the Jenkins configuration that I can tell Jenkins where the Android SDK is, but knows that it fails with a different error: I populated the Android SDK root field with / var / lib / jenkins / tools / android-sdk / , but it shows the necessary tools not found (adb, etc.),.
This is my ls -la in / var / lib / jenkins / tools / android-sdk
drwxr-xr-x 9 jenkins jenkins 4096 May 16 11:12 . drwxr-xr-x 5 jenkins jenkins 4096 May 15 20:20 .. -rwxr-xr-x 1 jenkins jenkins 6 May 16 12:36 .jenkins-install-info -rwxr-xr-x 1 jenkins jenkins 0 Dec 20 20:00 .timestamp -rwxr-xr-x 1 jenkins jenkins 1158 Dec 6 16:50 SDK Readme.txt drwxr-xr-x 2 jenkins jenkins 4096 May 15 19:45 add-ons drwxr-xr-x 3 jenkins jenkins 4096 May 16 09:02 build-tools drwxr-xr-x 19 jenkins jenkins 4096 May 16 09:49 docs drwxr-xr-x 3 jenkins jenkins 4096 May 16 11:12 platform-tools drwxr-xr-x 8 jenkins jenkins 4096 May 16 10:43 platforms drwxr-xr-x 2 jenkins jenkins 4096 May 16 11:12 temp drwxr-xr-x 9 jenkins jenkins 4096 May 16 11:11 tools
and this is ls -la in / var / lib / jenkins / tools / android-sdk / platform-tools
drwxr-xr-x 3 jenkins jenkins 4096 May 16 11:12 . drwxr-xr-x 9 jenkins jenkins 4096 May 16 11:12 .. -rwxr-xr-x 1 jenkins jenkins 467531 May 16 11:12 NOTICE.txt -rwxr-xr-x 1 jenkins jenkins 1226659 May 16 11:12 adb drwxr-xr-x 2 jenkins jenkins 4096 May 16 11:12 api -rwxr-xr-x 1 jenkins jenkins 176550 May 16 11:12 fastboot -rwxr-xr-x 1 jenkins jenkins 16644 May 16 11:12 source.properties
which clearly shows that adb exists and works, as the above command shows:
sudo -u jenkins ./adb version Android Debug Bridge version 1.0.31
Any help with this problem would be really appreciated.