Gradle changes loading failed - kotlin

I've created a Kotlin project which uses a Gradle build system. Here's my problem:
When I click "reload gradle project" - nothing changes, I still get this mistake (project failed at...).
How can I solve this problem?
P.S: More detailed description of my problem:
When I click "reload gradle project" - it starts realoading like this:
But then it goes back to what is on the first picture (project failed at...).

Related

Intellij auto build cannot detect java problem

I already check the checkbox build project automatically in Build, Execution, Deployment > Compiler.
But in my class, even I random type some wrong keyword, no any error is shown in build output windows.
For example, I change the keyword
private Integer id
to
private2324234 Integerfdsfsfswerer id;
, press Ctrl + F9, still no any compile error is shown, why?
In auto-build window, it even show
No compilation problems found
My IntelliJ version is 2022.3.1 (Community Edition)
I have done many things and finally success, but I think the critical step is
Right-click on pom.xml and then click on "Add as Maven Project".
For more details of the origin problem, the problem occur when I select File > new > project from version control and then enter the git url.
the project is a maven project.

LPCXpresso started rebuilding my entire project every time I do a regular build

LPCXpresso has been working fine, up until some point where it just starts to rebuild the entire project every time a build or debug is initiated.
Is there a simple way to fix this broken behaviour and make it start building correctly again?
Was having the same problem. Did basically the same correction as listed...
project -> properties -> C/C++ Build. Then Refresh Policy tab and "Add Resource" button. Select the top level project. Clean and rebuild. This fixed the issue for me.
Here is what has worked for me - I am not sure if all steps are really necessary:
clean all projects (Project->Clean...->Clean all projects, don't start a build)
Close LPCXpresso
delete .metadata folder (maybe make a backup)
delete the Debug and Release folders from every project in the workspace
Open LPCXpresso - there will not be any projects in your workspace
import the projects: right click in the project explorer->import->general->existing projects into workspace
click browse next to "select root directory" and click ok (this selects the workspace directory)
Select the projects you need and click finish
build each project individually by right clicking on them in the project explorer and selecting "Build Project" (build the projects in the correct order of dependencies)
You will need to recreate the debug target, make sure that "build configuration" is set to Debug, and select "enable auto build"
This worked for me, but I am not sure what the magic step is/was. Good luck!
Additional Info
Sure enough, the problem came back, as it always seems to do. I did a lot more digging and stumbled upon this blog:
https://mcuoneclipse.com/2015/06/06/eclipse-project-refresh-policy-broken-incremental-build-with-external-make/
The crux of this is: if the setting for "Refresh Policy" under Project->Properties->C/C++ Build/Refresh Policy is set wrong, then incremental build may be broken and you may get full rebuilds.
In my case, I had started a long time ago with a demo project and renamed it at some point in time. The refresh policy tab had one resource listed, which was the original project folder name.
I deleted that resource, then clicked Add Resource... and placed a check mark next to the top level project folder.
After cleaning things and rebuilding, now the issue seems to be fixed!

Is there an IntelliJ/Gradle log that contains this info?

I have a Gradle project in IntelliJ 2016.2. For Gradle tasks I know how to see the output. But whenever I change something in my build.gradle file, IntelliJ starts do to some Gradle stuff in the background , like refreshing dependencies and building.
Is there a way to see the output of those tasks running in the background? (The tasks run fine without an error, and I'd prefer not to break them just to get some output somewhere.)
As mentioned in the official support:
Now, you can see the output in the idea.log file.
To access the log file refer to the manual: Locating IDE log files
See more: Android Studio -> IntelliJ: "gradle console" missing, gradle compiler background task output

Intellij IDEA - JavaFX packager : access denied

I'm trying to generate an artifact of my JavaFX application using Intellij but for some reason I always end up having JavaFX packager throwing an access denied error on my output directory.
Generating a simple jar works fine though.
I'm using it on Windows 8.1 with Java 8.
I had the same problem. I kind of solved it:
by ticking the "Build on make" box in the Project Structur Dialog
starting a Run of my Java App in Intellij Idea
Now the executable jar magically appeared in my build folder. God knows why.
I had this problem and solved it by deleting the Artifact from IntellIJ, then deleting the "out/artifact" previously created folder where it tried to build my jar and finally re created an artifact from scratch. For no specific reason it now worked.
I have encountered the same problem recently. I checked the permissions of the directory and can read and write. Later I deleted the artifact and re-created a new one to solve the problem. I hope to help people who have encountered this problem.
I had this problem. I ran into it because When I added artifact with + button in Project Settings->Artifacts, I selected JAR artifact , and change JAR to JavaFx Application from type drop down box on right side pane. Later, I removed this artifact and pressed + button, then selected JavaFx Application from drop down list, then it was builded successfully. My JDK version is 8.
When I call JavaVXPacker from the command line I get the following:
C:\Users\Ingo>javafxpackager -help
javafxpackager.exe has been renamed javapackager.exe.
The original file may be removed in a future release in lieu of javapackager.
Please update your scripts.
...
...
So I guess IntelliJ has to update it's script to re-enable the feature???
(using Windows 10 and JDK Liberica 15+36)
Go to File > Project Structure
Click on Artifacts on the left panel.
Thereafter click on the plus icon to add a Jar From modules with dependencies…
A pop-up will be shown and there you would have to select for the startup class of your project.
Click on OK twice to save the changes.
Lastly go to Build > Build Artifacts... And select build action.
Now your jar will be generated in the out folder of your project.
For a more details guide, please refer to this post

Unable to make the module: related gradle configuration was not found. Please, re-import the Gradle project and try again

I use IntelliJ IDEA Ultimate 14 and Gradle 1.2. I manage the project from the console, but I need to debug some of the code from the IDE.
When I try to make the project, this error window appears. When I try to debug the project,
Error: Unable to make the module: idappcli, related Gradle configuration was not found.
Please, re-import the Gradle project and try again.
is written in the message window. How can I add the regular output paths to the project?
Try by opening the gradle task view and then click the refresh button. For me it solved the problem.
I also had a similar problem,
Go to : View -> Tool Windows -> Gradle.
Then press in Refresh Icon
This fixed the issue "Please, re-import the Gradle project and try again." for me (IntelliJ Ultimate 17.3.3):
(1) Detached Gradle project:
(2) Closed the project and (3) re-opened it via File > Open recent. IntelliJ will promt to import the now unlinked Gradle project. (4) Imported it and selected "Use auto-import" in the dialog.
I had the same problem with my Intellij IDEA version 2016.2 (Mac)
The solution was: In Intellij, Click on "View" then "Tool Windows" then "Gradle" then click on
I had to make sure the Use auto-import and the Use default gradle wrapper (recommended) were both checked.
File > Other Settings > Default Settings > Build, Execution, Deployment > Build Tools > Gradle
I faced the similar issue when i update my IntelliJ Idea.
To fix it i ran the below command in terminal and it fixed my problem.
gradle cleanIdea idea
For most people the refresh of Gradle that has already been suggested might solve the issue.
For the others I figured out, that deleting the .idea direcotory and reimporting the project might help.
It can be that your resources directory is not added to classpath when creating a project via Spring Initializr. So your application is never loading the application.properties file that you have configured.
To make a quick test if this is the case, add the following to your application.properties file:
server.port=8081
Now when running your application you should see in the spring boot console output something like this:
INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): **8081** (http) with context path ''
If your port is still default 8080 and not changed to 8081, your application.properties files is obviously not loading.
You can also check if your application runs with gradle bootRun from command line. Which most likely will be work.
Solution:
Close IntelliJ, then inside your project folder delete the ".idea" folder
Reimport your project to IntelliJ like following: "Import Project" -> "select ONLY your build.gradle file to import". (IntelliJ will automatically grab the rest)
build and run your application again
See official answer by IntelliJ Support:
IDEA-221673
This works for me:
Close the IntelliJ Idea
Delete 'gradle' and '.gradle' folders from the project root
Start IntelliJ Idea and import the project as gradle
In my case the root cause was a missing proxy configuration. Once I configured it properly I was able to Refresh gradle projects and it finally downloaded missing files and set up the project correctly.
File > Settings > Appearance & Behaviour > System Settings > HTTP proxy
then
View > Tool Windows > Gradle
and Synchronize button
I went into the IntelliJ Gradle preferences:
Menu: Preferences > Build, Execution, Deployment > Build Tools > Gradle
And under Project Level Settings, switched the radio button to "Use default gradle wrapper (recommended)"
Hit the make button, and was in business!
#user1339 I also had the same problem. Please, read this question Building war with Gradle, Debugging with IntelliJ IDEA. It'll be very helpful for you. And recommendation for the 'Make' task. As message said, I should try to re-import the Gradle project and try again. In my case this advice became very helpful.
I recommend to try to 'Build > Rebuild Project'.