Maybe add a collect_android() function which would exit early if sys.getandroidapilevel() doesn't exist?
> * The NDK version can be obtained by parsing the file $ANDROID_NDK_ROOT/source.properties.
> * The versions of the SDK build-tools, emulator and platform-tools packages as well as those of the system images can be obtained by parsing the output of "$ANDROID_SDK_ROOT/tools/bin/sdkmanager --list".
You are free to add whatever you want/need, but just try to handle properly errors to collect other info even if these data cannot be read.