Getting GradlePluginsRuntimeException

Hi,
I’m getting following exception while creating a custom project.
org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Can’t read root project location for project located at
I created this file org.eclipse.buildship.core.prefs in the .settings folder of my project programmatically when pressing finish button in the new project creation wizard. I added these entries in this file
connection.project.dir=\n
eclipse.preferences.version=1
programatically. The file is successfully created with the above entries in the project but still I get the same exception
org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Can’t read root project location for project located at
in the console after creating my custom project. How to fix this exception?

I’m just guessing but I assume you want to implement a custom plugin that creates a Buildship project.

You don’t need to interact with the preferences directly, there’s a public API you can use to import and synchronize projects. Look at the org.eclipse.buildship.GradleWorkspace as an entry point. You can generate a custom project structure and then import it with the mentioned API.

Nonetheless, connection.project.dir should always point to the root project location. For the root project, the value should be an empty string.