I am trying to get the latest revision number of mercurial repository dynamically and have it in the versionName of the android app.
This is what I have in the grad
The issue I had with this was that I'd messed up the path contained in my ~/.profile file.
I solved it by running export PATH=/opt/local/bin:/opt/local/sbin:$PATH in my terminal to get back my ability to use vim. Then I just pasted the same command: export PATH=/opt/local/bin:/opt/local/sbin:$PATH into my ~/.profile.
Invalidated the cache from Android Studio, and it worked like a charm.
I hope this helps someone!