Use the Android SDK Manager plugin with Jenkins

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

When building an Android application using Gradle on Jenkins with the Android SDK Manager Gradle plugin, there may be an error running the aapt tool. Typically, this produces an error message like that shown below: Cannot run program ".android-sdk/build-tools/22.0.1/aapt": error=2, No such file or directory
  at java.lang.ProcessBuilder.start(
Caused by: error=2, No such file or directory
  at java.lang.UNIXProcess.forkAndExec(Native Method)
  at java.lang.UNIXProcess.<init>(
  at java.lang.ProcessImpl.start(
  at java.lang.ProcessBuilder.start(
  ... 4 more

To resolve this, execute the following command to install missing libraries needed by the aapt command:

  • Debian:

    $ sudo apt-get install lib32stdc++6 lib32z1
  • CentOS:

    $ sudo yum install libstdc++.i686
Last modification August 23, 2019