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
This solved the issue for me
1) Update to latest Android Studio(optional)
2) In the studio, File -> Project Structure -> take a note of the directory path for "Android NDK location" and open the folder on your machine. Now Step out into the /sdk/ folder and delete the "ndk-bundle" folder. This takes a bit of time because of all the files.
3) Back in Studio, open File -> Project Structure -> take a note of the directory path for "Android NDK location" again , and this time you shoul dbe seeing an error. Delete the "Android NDK location" path -> click OK
4) Rebuild the project, Invalidate caches and restart.You shouldn't see the error anymore.