Android - working with Gradle: purging gradle cache

To force refresh the dependencies for gradle build you can first try running the task with --refresh-dependencies switch

The whole command would be

gradle --refresh-dependencies <task>

If that does not work for some reason you can try removing the ~./gradle/caches folder

rm -rf $HOME/.gradle/caches/