[build-tools] Make configure-version gradle script compatible with AGP 9 (#4155)