Grails application is not found after updating to IntelliJ IDEA Ultimate 2016.2 - intellij-idea

I have updated my IntelliJ IDEA Ultimate to the 2016.2 version.
I had a Grails 3 project and now when I open the IDE I get the following error when trying to run my project:
Error running Grails: My_Project: Grails application is not found
I can still open the terminal and run the project manually, but it seems that IntelliJ IDEA no longer recognises my Grails application. When going to "Edit configurations...", in "Application" it says "[none]" and I can't select anything.
Grails Version: 3.1.9
Groovy Version: 2.4.7
JVM Version: 1.8.0_66

A Simple solution to this is to refresh the gradle projects.
You can do this by popping out the little gradle tab and hitting the "Refresh All Gradle Projects"

I run into the same problem always when i restart intellij. Running grails clean command from the terminal fixed it.

First, re-import the project into IntelliJ 2016.2. Choose the build.gradle file for the import. Use the gradle wrapper or a local gradle installation, where you have given IntelliJ the path to the locally installed Gradle. Let IntelliJ re-index everything. Wait until you see no further indexing on the bottom of the screen.
Second, run the application once, with no edit configuration. After this completes with error, you should be able to choose Run -> Edit Configuration / Application.
Third, you can go into the project pane to the grails-app/init/app-name/Application.groovy file and right-click on that and choose Run. After that, an edit configuration will be created.
Finally, you can try to invalidate cache and restart. (This has nothing to do with Edit Configuration, but sometimes the gradle and/or .idea caches get out of sync.)

I had the same problem after updating to IntelliJ Ultimate 2019.2.
It seems that the "little gradle tab" of the accepted answer no longer exists.
The reason in my case was that the Gradle Plugin had been disabled by the update process.
Resolution: Hit Help > Find Action > Type gradle. You should see a line "Gradle" and a ON-OFF switch at the end of that line.
Enable it and restart IntelliJ solved my problem.

Related

Intellij error - test framework quit unexpectedly intellij

I have been trying to run junit test but facing this issue constantly. I tried to look for answers on the internet but nothing helped.
]1
If there is an error e.g.
"CommandLineWrapper is ill-suited for launching apps on Java 9+..."
Then, try the following workaround in IntelliJ IDEA:
Run -> Edit configurations -> select the failed running config -> Shorten command line: #argfile (Java 9+) -> OK
For IntelliJ 2019 and above go to :
Settings-> Build,Execution,Deployment -> Build Tools -> Maven -> Running Tests and
Uncheck argLine
I had same issue but it has been resolved by updating the Intellij latest version 2020.3. Now i am able to run the test without any error. Please check below link for latest Intellij versions
https://www.jetbrains.com/idea/download/
I had previously installed zulu and Oracle Java and then switched between the two quite a bit.
I ended up having many JDKs
Here's what helped me.
In intelliJ, go to Run, the Edit Configurations.
In the Run/Debug Configurations window, under Build and run section, select 'Java Bundled'.
To make sure this applies for all tests, click on the edit template icon (the spanner), select JUnit and then in the Build and run section select 'java Bundled'
Make sure all the configurations under JUnit has 'java Bundled' as well
Click Apply and Ok. Try to run the tests now and it should probably work.
For me the problem was that I had some incompatible/old dependencies in my SBT project.
I updated the versions of every 3rd party in the SBT config and running ZIO tests in IntelliJ started working.
For me also, the problem was that I made a change in the dependecies and the dependecy updated was incompatible in the SBT project.

"java.lang.IllegalArgumentException: Area already instantiated for: ProjectDefault (Template) Project" Idea-SBT plugin error

I'm using intellij Idea 2019.2 ultimate edition. After I updated from 2019.1. 2019.2 edition I get below exception frequently.
I couldn't submit the report to SBT as the report button is always disabled.
How could I stop this exception other than disabling the plugin?
The plugin hasn't been updated in a while and has the following deprecation messaged on its website:
DEPRECATION JetBrains have recently added support for an SBT console
to the IntellIJ Scala Plugin. This is now the recommended way to use
SBT within IntellIJ. No new releases of this plugin are planned.
Go to the "Before launch" options of a Run Configuration, uncheck
"Make" and choose "Run SBT Action / test-compile" to compile the
project with SBT. This plugin does not generate or synchronize your
IDEA project structure from the SBT build configuration. We recommend
using the native support for importing SBT in IntelliJ. For more
details, see:
http://blog.jetbrains.com/scala/2013/11/18/built-in-sbt-support-in-intellij-idea-13/
I figured I don't need it anymore and uninstalled it. This doesn't really answers you question but I don't think this issue will be solved by the plugin maintainer.

Can't find SBT-shell in IntelliJ IDEA

Facing some issue with the build, I deleted the project and .idea directories of my SBT project (containing submodules) followed by Invalidate Caches / Restart... (invalidated the cache too)
Ever since relaunch of IntelliJ, I can't locate the sbt shell
Interestingly, I'm still getting the sbt shell when I open my other projects (in which I didn't delete the project and .idea directories) in IntelliJ
I can confirm that I have the latest release of IntelliJ IDEA for MacOS with the Scala plugin installed
what fixed my problem was:
install scala plugin
restart
file -> close project
instead of open, click new project, select scala with sbt option,
then next
select the same project as location.
hope it will save you time and energy
In Intellij 2018, under Preferences - Build, Execution, Deployment - Build Tools - sbt, check "Use sbt shell for build and import (requires sbt 0.13.5+)". Then restart Intellij. The sbt shell tool window tab will appear in the bottom pane (if not, select it from View - Tool Windows - sbt shell).
In my case, scala plugin needed to be updated and accordingly this caused sbt to disappear from build tools. Go to Settings --> Plugins --> Updates and make sure that scala plugin is updated. If it wasn't and you updated it, you should restart the IDE afterwards.
After that removing the .idea folder and reimporting the project was necessary for the project to build.
You can select
Window → Restore Default layout
Or press Shift + F12
This will restore your default window layout and the tab will be visible again (You can check this works by hiding the sbt tab by right clicking and selecting 'Remove From Sidebar').
Some windows such as Maven or Ant need to be brought back by
View → ToolWindows → [Window Name]
In my case I enabled the sbt shell going to "File - Settings - Build, Execution, Deployment - Build Tools - sbt " and after enabling here, you need to restart your intellij and then you can find sbt-shell here "view- Tool window - sbt shell"

IntelliJ IDEA: Unable to create a Gradle project

I'm facing difficulties in setting up a gradle project. During setting up of the Gradle settings in the wizard,
I am not able to use the default recommended gradle wrapper because it downloads the Gradle and the network connectivity is very bad. So I go with the local gradle distribution which I have installed in my Ubuntu. On refreshing of the gradle project after creation, I always get stuck to this error. When I run the gradle build command through the terminal on the empty project, It works fine.
I have also tried the troubleshooting solutions given by the IDE. But, that made no improvements. Need assistance to solve this problem.
Comment if any additional info required.
As no-one else has chipped in, an approach that should work is to use the Gradle Idea Plugin instead of relying on the build in support Gradle in Idea. In my experience the plugin supports a wider range of Gradle project structures than Ideasupports directly. So you would
Create a Gradle project outside Idea and confirm it all works on from the command line.
Add the Idea plugin to the project
Run 'gradle cleanIdea idea' to generate the Idea project files.
Open up the newly generated project files from Idea and off you go.

IntelliJ IDEA Kotlin plugin - "there aren't configurators available"

I'm having problems using the Kotlin plugin in IntelliJ IDEA. First, upon opening a kotlin project, it pops up that I need to configure Kotlin in this project. But when I do so from the Tools menu, it says "there aren't configurators available"
I had this same problem in Android Studio 3.0 Canary 1. Cneal build, Synchronize, Invalidate Caches and Restart didn't help.
The only thing that worked was to make a change to a build.gradle file and click "Sync now".
I had the same problem with one of my Kotlin gradle project.
Go to View -> Tool Windows -> Gradle. There should be a Reimport all Gradle Projects icon at the top. (Circle with double arrows). Just click on it and it should refresh your gradle project with Kotlin configuration.
I realized the problem was my Gradle plugin was disabled.
This happened to me with Kotlin 1.3 and IntelliJ 2018.2.6.
I tried all the above solutions listed---none of them worked until I actually deleted the .idea folder and .iml file from my Kotlin gradle project directory and then re-imported them in IDEA, then all was well.
Restarting Android Studio and then going to File -> Invalidate Caches, checking "Clear file system cache and Local History" and "Clear VCS Log caches and indexes", and clicking the "Invalidate and Restart" submit button fixed the problem for me :)