Check out example codes for "cannot lock java compile cache as it has already been locked by this process". It will help you in understanding the concepts better.

Code Example 1

find ~/.gradle -type f -name "*.lock" -delete

Learn ReactJs, React Native from akashmittal.com