Setting this as false in gradle.properties also works. Build will take longer time than normal as it won't use buildCache.
org.gradle.caching=false
Once successfully done, set it back to true