I have installed Android studio and i have created the new project but it is giving me the error:
Gradle \'MyApplication2\' project refresh failed
Gradle sy
Go to your project folder right click ->Properties->under Security tab on it check permission and allow all permissions.
if there is permission related issue. Then you can change the gradle path from C to D drive. it will fix the issue
I have had a similar issue recently when the gradle plugin release was updated to 5.1.1. which caused an error message "apollo\generatedIR\debug (Access is denied)".
In order to fix this I had to revert back to the previous gradle version which was 3.3.2 and I had to make sure that the zip file that is downloaded when the project syncs matched the 3.3.2 version.
Here is where to check the versions of the gradle builds: https://developer.android.com/studio/releases/gradle-plugin
The changes I made where:
In the gradle (project) file change the classpath plugin to the previous version:
classpath 'com.android.tools.build:gradle:3.3.2'
Then in the gradle-wrapper.properties file change the distributionUrl to match the required gradle version.
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Then resync your project. If it doesn't work double check your gradle files by going to the C:Users//.gradle/wrapper/dists folder and it should match the version on the web page above.