Android emulator plugin does not find Android SDK

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.

+4
source share
3 answers

It seems that there is an error trying to accept the license agreement, as reported in this issue , and the plugin is also looking in the wrong place to find adb , since SDK 22 moved it from the original location ( issue ).

+5
source

You can "fix" the missing adb problem by creating a symbolic link from the platform tools / adb to tools / (or vice versa).

+1
source

The plugin has this open problem with sdk22, sdk22 moved aapt to. / build -tools / 17.0.0, and this quietly causes the plugin to not find sdk, and so try and download a new one: https://issues.jenkins-ci.org/browse/JENKINS-18015

The workaround in describing the problem, adding a symlink, really worked for me. But I also had to delete the avd files in .android / avd / (which were created using sdk21) so that they were recreated with the new sdk.

+1
source

Source: https://habr.com/ru/post/1481432/


All Articles