Update my gradle dependencies in eclipse

Solution 1:

You have to select "Refresh Dependencies" in the "Gradle" context menu that appears when you right-click the project in the Package Explorer.

Solution 2:

Follow those steps to update Gradle project in Eclipse:

  1. First, please check you have include eclipse gradle plugin. apply plugin : 'eclipse'
  2. Then go to your project directory in Terminal. Type gradle clean and then gradle eclipse.
  3. Then go to project in eclipse and refresh the project (Go to Project Explorer, select root of the project and hit F5 to refresh, or right click and select refresh in context menu).

enter image description here

Solution 3:

Looking at the Eclipse plugin docs I found some useful tasks that rebuilt my classpath and updated the required dependencies.

  • First try gradle cleanEclipse to clean the Eclipse configuration completely. If this doesn;t work you may try more specific tasks:
    • gradle cleanEclipseProject to remove the .project file
    • gradle cleanEclipseClasspath to empty the project's classpath
  • Finally gradle eclipse to rebuild the Eclipse configuration

Solution 4:

You have to make sure that "Dependency Management" is enabled. To do so, right click on the project name, go to the "Gradle" sub-menu and click on "Enable Dependency Management". Once you do that, Gradle should load all the dependencies for you.

Solution 5:

I tried all above options but was still getting error, in my case issue was I have not setup gradle installation directory in eclipse, following worked:

eclipse -> Window -> Preferences -> Gradle -> "Select Local Installation Directory"

Click on Browse button and provide path.

Even though question is answered, thought to share in case somebody else is facing similar issue.

Cheers !