Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Gradle Plugin 'could not fetch model of type'

I am running Eclipse Luna on OS X with Gradle IDE 3.6.1 and anytime I try to select a project from the gradle tasks panel I get the following error:

org.eclipse.osgi.internal.framework.EquinoxConfiguration$1
Could not fetch model of type 'EclipseProject' using Gradle distribution 
'https://services.gradle.org/distributions/gradle-2.0-bin.zip'.

Has anyone else run into this error? I can get to the URL specified to download the file myself. So, network connectivity shouldn't be the problem.

like image 724
Michael Avatar asked Oct 09 '14 14:10

Michael


People also ask

What is Gradle user home?

The Gradle user home directory ( $USER_HOME/.gradle by default) is used to store global configuration properties and initialization scripts as well as caches and log files.

How do I create a Gradle project in STS?

Go to the New project wizard (Ctrl-N) of STS Eclipse and create a Gradle project. On the Gradle Projec t wizard , assign a name for your project and choose Java Quickstart for the Sample project option. Click Finish and it will take a while to create, build, clean, and install your Gradle STS project.

How do I import a Gradle project into STS?

Step 1: Open your Eclipse IDE and go to File » Import. Step 2: Search for Gradle, expand the folder and go to Gradle » Existing Gradle Project » Next. Step 3: Specify the root directory of the Gradle project to import and click on the Next button.


2 Answers

The problem is for the java version configured by default on the IDE (Eclipse or Spring Tool Suite). The error is the following:

enter image description here

To fix it, you can set the Java version supported by the Gradle version in Configure Workspace Setting option.

enter image description here

enter image description here

Finally, you can refresh your project o continue with your creation. Later all will be perfect.

enter image description here

like image 157
martosfre Avatar answered Oct 09 '22 01:10

martosfre


I had the same error in Eclipse Neon (version numbers were different, but otherwise same error). It looks like several different things can cause this error, but for me it was an incorrect property in [MyProject]/.settings/org.eclipse.buildship.core.prefs.

I had

connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)

but it needed to be

connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(2.13))

2.13 should be replaced with whatever version number output you get from gradle -version.

Coming back to add this: It turns out, the actual root problem was an incompatibility between Gradle versions. My build.gradle file worked fine with an old version of Gradle, but uses things that were deprecated and removed in later versions.

Solution is to click Finish immediately in the wizard instead of Next, and then fix the issues in the build.gradle.

like image 33
Josh Davis Avatar answered Oct 09 '22 00:10

Josh Davis