Android studio stuck at Refreshing Gradle project

前端 未结 17 1889
别那么骄傲
别那么骄傲 2021-01-31 15:01

Updated Android studio to 1.2.2 and the background process wont end.(Refreshing \'MemoryCards\' Gradle project).

It has been more than an hour now and its still busy?

相关标签:
17条回答
  • 2021-01-31 15:27

    In Android Studio select:
    File\Settings\Build, Execution, Deployment\Build tools\Gradle
    click on the button on the right side showing local gradle distribution path.
    you will be taken to the gradle folder.
    click ok in this dialog box and your path will be updated!

    restart android studio and you are good to go!

    The Problem:
    in my case path selected after the update was of older version e.g:
    C:/Program Files/Android/Android Studio/gradle/gradle-2.4
    However, after the update it was changed to:
    C:/Program Files/Android/Android Studio/gradle/gradle-2.8

    P.S:
    This solution also resolves following error:
    buildTypes cannot be applied to groovy.lang.Closure

    0 讨论(0)
  • 2021-01-31 15:27

    In my case, I download Gradle zip from the web site, and set the gradle local home, enabled offline work. Then "file" menu -> restart. It worked for me.

    0 讨论(0)
  • 2021-01-31 15:28

    Change gradle home directory to exist location.

    0 讨论(0)
  • 2021-01-31 15:28

    Answer of Lloric is the perfect answer.

    Go to Settings > Build Tools > Gradle

    Then change the Gradle Home path to the existing path.

    Probably you are facing problem now with gradle-2.10

    Browse directory, you will find out gradle-2.14.1 as of mine or later versions.

    Change it to that then rebuild your project.

    0 讨论(0)
  • 2021-01-31 15:32

    If you get a connection timed out error this is usually a problem of proxies. Try disabling them if you are using proxies.

    Also, when gradle is stuck, deleting the .gradle folder in c:\Users\ always helped me.

    0 讨论(0)
  • 2021-01-31 15:33

    A few things to try in the following order:

    1. Restart the entire PC, then try again...

    2. If that fails then clear the cache for android studio, restart
      android studio and try again..

    3. Disable any proxies on your PC / network / Android studio then try again

    If that doesn't work then look at clearing the gradle files and re-downloading them. Let me know how this goes please and I can update my answer with further things to do if needed.

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