How to fix "Missing Gradle project configuration file" issue in Buildship?

I've figured it out myself. The issue with the "missing gradle project configuration file" arises from the way the gradle project(s) are imported into Eclipse.

When importing a gradle project via the regular File -> Import -> General -> Existing Project into Workspace command, then it will not work and produce the aforementioned error.

However, if you import the very same project via File -> Import -> Gradle -> Existing Gradle Project, then you get a different import wizard, and with this wizard, it works like a charm.

I still think it's a bug because the choice of the import wizard should not matter. Still, choosing the proper wizard is a viable workaround.


I seriously searched for the solution, but only found workarounds. Alan47's solution created the file for me, but couldn't create the project properly in my case. So I just copied the file created and imported the project again in the default way:

File -> Import -> General -> Existing Project into Workspace

and pasted the file again at the directory

./.settings

The name of the file:

org.eclipse.buildship.core.prefs

The content of the file is only:

connection.project.dir=
eclipse.preferences.version=1

Another option is to:

  1. Move to your projects path (where gradle or gradlew is found)
  2. Unix: sh gradlew cleaneclipse Win: gradlew cleaneclipse

Requires the apply plugin: 'eclipse' in your build.gradle

  1. Refresh your Project in eclipse.
  2. After that for Unix: sh gradlew eclipse Win: gradlew eclipse

Now the gradle nature will be missing in your eclipse-project. Open the context menu of your project -> configure -> add gradle nature

Now everything should be fine again.