No Gradle Tasks appearing under projects in eclipse - eclipse

I have an eclipse project that is running inside of the VM. It uses gradle and has the eclipse buildship plugin installed. The build.gradle file is present but for some reason it won't show any gradle tasks for the project like it normally does. It also has a red x by the project names and gives me the error that "import *** cannot be resolved" for basic things like ImmutableLists even though the import statements are all present at the top of the files. Does anyone know what the problem might be? Picture showing the red x's as well as the options I have selected

Related

Eclipse Gradle project shows dependency errors : the container 'project and external dependencies' references non existing library

Eclipse Gradle project shows dependency errors.
the container 'project and external dependencies' references non existing library
Got the same error. Gradle -> Refresh Project.. did not fix it.
Close Project, then Open Project did fix it.
Eclipse Gradle projects have a button to refresh the gradle project, but it is not really obvious and does not trigger when trying to 'quick fix' the error in eclipse.
Right-click on the desired Project that has dependency errors
In the menu select Gradle
Click 'Refresh Gradle Project'
This will remove the errors but could take a few minutes to process.
If the errors are still present in eclipse you should try to refresh dependencies and build with gradle outside of eclipse on the command line and see if that works to rule out eclipse/gradle sync as your issue.
Example of gradle command line to refresh and build (use gradlew if your using a gradle wrapper):
gradle clean
gradle --refresh-dependencies
gradle build -x test
gradle test (optional)
I get this same error. It happens randomly every now and then, to most projects I have imported into Eclipse. Gradle misses some random dependency even though it's on the disc. Below image shows 6 different projects failing and next picture shows none-existing library reference actually exists.
.
A Gradle refresh usually does not solve it. To solve it I have to delete the project from Eclipse (not disc), then manually remove .classpath/.project files and .settings folder, then import project into Eclipse again. Very annoying :/
Based upon the feedback from the other answers, you probably should file an issue against Buildship, as this seems easy to reproduce. However, there already is one issue #985 filed, which states that the reason would / might be a read-only .classpath or .project files.
I tried all the suggestions above. Unfortunately, none of those steps helped me.
On Mac, this is what I had to do...
$ brew upgrade gradle
(this upgraded gradle from 5.0 to 6.7.1)...
$ cd /project_root
$ gradle help --scan
$ gradle wrapper --gradle-version 6.7.1

Eclipse / LibGDX can't load Tools extension -> Particle Effects

I'm trying to add the LibGDX "Tools" extension to an existing project in order to use a particle emitter, but it doesn't seem to be working.
I initially built the particle emitter I'm trying to use in another workspace, but I've copied the particle emitter file into the assets folder of this current project and I've copied over the code that was working in the other project. When I run the other project it runs fine, but in this one I get the following error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: particle.png
As per the documentation, I've added the following line to the build.grade file in the root of my workspace:
compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
The documentation says I then have to "refresh gradle dependencies" but there doesn't seem to be any option to do that in Eclipse (I'm using version 3.8.1 in case that helps).
So I suppose my main question is how do I refresh the gradle dependencies? I read one post somewhere that said you right-click on the project and choose "Refresh Dependencies" from the Gradle menu, but there is no Gradle menu in the right-click menu (or anywhere else, as far as I can tell)
When poking around the menus in Eclipse I found an option to "Convert to Gradle project". On a hunch based on what was said in noone's first comment I tried that. This gave me a "Gradle" menu in the right-click menu, so I chose "Refresh All" from the Gradle menu and now it works :)

Open "gradle" project

I am an Android beginner and I downloaded the DisplayBitmaps project from the following link:
http://developer.android.com/training/displaying-bitmaps/index.html
It seems that there are no java files under the "src" folder but i find some codes under the folder "java" and a new item called "gradle".
I googled "gradle" and downloaded the eclipse plugin as suggested by the following link:
http://forums.gradle.org/gradle/topics/gradle-2-3-released
In Windows cmd, i have checked that gradle has been installed in my computer but i just don't know the next steps required in order to execute the project. I searched a long time and a bit confused by the solutions posted online.
It seems that gradle is q common but there are not many well documented tutorials on importing gradle into eclipse. It will be great if anyone would share some useful materials, many thanks in advance.
Install Gradle Eclipse plugin from this update site: http://dist.springsource.com/release/TOOLS/update/3.6.4.RELEASE/e4.4
(The update site is for Eclipse 4.4.x, put 4.5 at the end of URL if it's Eclipse 4.5 you are using)
Once installed import project as Gradle project. Don't forget to click on "Build Model" in the import wizard once you point to the right folder where the project to import is.
Once Gradle project is properly imported it'll have java nature applied to it and it'll have the appropriate folders...

Disable automatic Gradle build in Eclipse for one project

I have multiple gradle projects in my workspace which get build automatically.
The problem arrises from one project which fails this automatic builds so an error dialog pops up regulary which is quite annoying. Since the project is just a simple prototype and the only person which has it running locally is currently on vacation there is no fix in sight.
I could easily close the project in eclipse but I have to refer regulary to it as a code reference which obviously isn't possible when the project is closed.
Is there an easy way to disable the automatic Gradle build for only this project while keeping the builds for the other Gradle projects in my workspace functional?
Many thanks in advance.
Okay I found the way.
Just right click on the project in the package explorer and choose Gradle -> Disable Dependecy Management.

Errors running builder 'CDT Builder' on project 'proj1' (eclipse CDT)

I have a question about how to import an project that contains an existing make file into eclipse.
From reading the eclipse documentation it seems that i should use a "Makefile Project"
Is this correct?
If so then the import of the project files seems ok, but when I run build I get:
Errors occurred during the build.
Errors running builder 'CDT Builder' on project 'proj1'.
Internal error building project proj1 configuration Default
java.lang.NullPointerException
Internal error building project proj1 configuration Default
java.lang.NullPointerException
ok. So I i assume that i am getting this because the build target points to nothing. So i got to Project-> Properties -> C/C++ Build and all the "builder settings" are grayed out.
My next attempt was to go to Project -> Make Target -> Create. What i see here is:
Target name:
Make Target:
Use Builder settings:
I made several attempts at putting values into these fields and running make again, but I get the same error.
When using eclipse CDT in the past i have always created the project myself so eclipse handled the whole make thing for me. But I am at a loss of how i actually tell CDT what make file to use or why I am receiving the above error message.
So i gues my question is if i want to import a C project with an existing file how do i tell eclipse what make file to use? In the flow i chose these options seemed grayed out.
I tried looking this up on stack exchange, but have not found an exact match for my situation
Thanks in advance.
It looks like something went wrong with your import. You should have imported your code via Existing Code as Makefile Project. The build command can be defined in the project-properties dialog, under C/C++ Build, Behaviour tab, in case you have a specific situation.