Use the Android SDK Manager plugin with Jenkins

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:

    $ sudo apt-get install lib32stdc++6 lib32z1
Last modification December 21, 2022