At office, I am behind a proxy. The internet access is restricted.
So I performed a gradle sync at home and copied the folder \".gradle\" present at C:\\Users\\user
I'm using android studio in MacBook
step 1 - Go to preferences by clicking android studio on the left uppermost corner.
step 2 - Go inside Build,Execution,Deployment.
step 3 - Finally select Gradle.
step 4 - then, uncheck offline work. Click apply then ok.
step 5- lastly try to sync once again.
Hope this will work because it works for me.