5

I updated my android studio few days ago to version 2.1 and now whenever I open a project in it or import a project it says in the bottom refreshing 'project name' gradle project I waited four hours for it to refresh but it not moving further help me out with this because i need my android studio normal any help would be much appreciated thank you in advance. Here is the image of my problem

Phiter
  • 12,987
  • 14
  • 45
  • 77
Ruby prO
  • 89
  • 2
  • 12

5 Answers5

3

I experienced a similar problem after updating my android studio and fixed it by pressing ctr+alt+s then selecting the gradle tab and fixing the location of my local gradle distribution. somehow after the update the location changed from the correct

"D:/Program Files/Android/Android Studio/gradle/gradle-2.14.1" to

"D:/Program Files/Android/Android Studio/gradle"

mungujn
  • 63
  • 1
  • 10
2

Try deleting all the .lock & .lck Files from .gradle directory from your home folder and rebuild

steps

  1. search for .lock files in C:\Users{USER}.gradle
  2. select and delete them all
  3. search for .lck files in C:\Users{USER}.gradle
  4. select and delete them all
0

Try deleting the .gradle directory from your home folder and the project folder and rebuild the project.

jayeshsolanki93
  • 2,041
  • 1
  • 17
  • 37
  • do i have to delete .gradle folder from every project i want to open because when i delete from a project then only it works – Ruby prO May 10 '16 at 11:56
  • when i delete the gradle folder from home directory and project directory and build it again it says gradle project sync failed – Ruby prO May 10 '16 at 14:02
  • please someone help me here what is the problem i am getting again and again – Ruby prO May 10 '16 at 14:51
  • Are you sure everything is up-to-date? Update the sdk build tool and update the `buildToolsVersion` in gradle.build with the same. And update the `classpath` to `com.android.tools.build:gradle:2.1.0` in gradle.build(project level). Then go to `File` -> `Invalidate Caches / Restart...` Tell me if the problem persists – jayeshsolanki93 May 10 '16 at 14:53
  • everything was updated i only updated gradle and it's fine now thank you. but whenever i import the project the problem still persisits why is it so? – Ruby prO May 11 '16 at 00:52
  • Maybe its taking to much time to build. Check this [answer](http://stackoverflow.com/a/37063659/2686502) – jayeshsolanki93 May 11 '16 at 04:25
  • thank you i have sent you request in skype please add me – Ruby prO May 12 '16 at 00:21
  • http://stackoverflow.com/questions/41502164/android-studio-2-2-3-gradle-build-running-stuck – Aditya Vyas-Lakhan Jan 06 '17 at 10:36
0

When open your project do not click on error messages "fix plugin and refresh project" it will led you infinite waiting. Instead go to build.gradle file and change plugin version to your current version and then Sync project.

Kharak
  • 392
  • 5
  • 18
0

It's probably because downloading the new version gradle costing too much time. It is wating for the downloading, so studio stucks.

If you don't want to wait, just modify the gradle-wrapper.properties file(It's path is YOUR_PROJECT/gradle/wrapper/) to your previous version, e.g.

distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

and restart the studio.

Yisu Zhang
  • 89
  • 1
  • 2