Gradle sync failed: Access is denied

前端 未结 3 1290
栀梦
栀梦 2021-01-18 16:03

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         


        
相关标签:
3条回答
  • 2021-01-18 16:21

    Go to your project folder right click ->Properties->under Security tab on it check permission and allow all permissions.

    0 讨论(0)
  • 2021-01-18 16:29

    if there is permission related issue. Then you can change the gradle path from C to D drive. it will fix the issue

    0 讨论(0)
  • 2021-01-18 16:34

    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.

    0 讨论(0)
提交回复
热议问题