I recently faced an issue with my Azure CI pipeline when I tried to build apk for Android.
I get the below error:
Build-tool 31.0.0 is missing DX at /usr/local/lib/android/sdk/build-tools/31.0.0/dx
FAILURE: Build failed with an exception.
- What went wrong: Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
Work Around: I found a workaround for me when I changed my "cordova-android" version to "8.1.0" from "9.0.0" in package.json file or you can use "ionic cordova add andorid@8.1.0" instead of "ionic cordova add andorid".
Hope it helps.