Error as follows:

Caused by: java.io.IOException: Cannot run program “/ var/jenkins_home /. Gradle/caches/transforms – 2 / files – 2.1/9 aaeb1036ed80346e59fdc652224e30d/aapt2 – – Linux/aapt 3.4.1 track – 5326820 2”: error=2, No such file or directory

Solutions:

  1. If you’re Jenkins on a server, the system is Ubuntu /Debian

Sudo apt-get install lib32stdc++6 lib32z1

  1. But if you’re Jenkins and you’re running Docker and Docker is Alpine system. Is more troublesome, need the following steps:
Jenkins Docker ps // Copy Jenkins Docker CONTAINER ID sudo Dockerexec-it -u root 3b781adce809 /bin/bash //3b781adce809 Apk add --no-cache --update --virtual=. Build-dependencies ca-certificates wget wget https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -O /etc/apk/keys/sgerrand.rsa.pub wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk - O/TMP/glibc. Apk wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-bin-2.32-r0.apk - O/TMP/glibc - bin. Apk apk add --no-cache /tmp/glibc.apk /tmp/glibc-bin.apkCopy the code

Reference links:

stackoverflow.com/questions/51914246/error-on-android-build-aapt2-error-2-no-such-file-or-directory/51914803#51914803

Github.com/sgerrand/al…