Intellij shows every line in build.gradle.kts is red - kotlin

I created a new project from VCS (Kotlin and Gradle). I added three testImplementation() calls to the build.gradle.kts. IntelliJ didn't pickup the changes so I did File -> Invalidate caches / Restart and now Intellij shows every implementation() call and every testImplementation() call in red. In fact every line in every build.gradle.kts in every module is red.
Intellij has lost its mind. What do I have to do to restore IntelliJ's intelligence when it comes to kotlintest in Gradle?

I started seeing this with AS 4.2.1. Invalidating caches and re-importing the project didn't work for me. I found this article on the JetBrains issue tracker where people found that they had an extraneous JDK set in the project settings. While I did not have an extraneous JDK set in my project structure, I tried changing the JDK from the AS embedded version to an alternate AdoptOpenJDK 1.8 version I had installed. After switching to that version all the red went away and everything is resolving as expected. I was then able to switch the SDK back to the embedded version and everything continued working as expected. When switching back to the embedded version I did notice a brief message in the progress bar at the bottom of AS saying that it was processing a JDK 11. I'm not sure where that's coming from, but it does seem to be in line with what others in the JetBrains issue were talking about.

The way I was finally able to solve this was with File -> Invalidate caches / Restart. It must have been cache corruption.

What do I have to do to restore IntelliJ's intelligence when it comes to kotlintest in Gradle?
Re-import the project: File | New | Project from Existing Sources action and select build Gradle file to load the project from.

Change your jdk.
Go to File>Project Structure > SDK Location > GradleSettings
Change the Gradle JDK to use the embedded or a compatible JDK (Azul JDK) if you're using a MAC.
Then Invalidate and refresh cache after deleting the .idea and .gradle files.

Related

IntelliJ IDEA Ultimate with Play Framework 2.6.7 Java imports 'symbol not resolved'

Be it an example project, freshly downloaded from Play Framework's website, or my project which is derived from that with a few changes to templates - nothing big - IntelliJ just can't seem to find the appropriate dependencies or sources necessary for Play development.
I've already installed Scala plugin for IntelliJ, which includes support for Play Framework. I'll outline the process that I've followed, after reading multiple articles from Play's documentation as well as questions asked on here though no answer has proven incredibly useful as yet.
Open Project Settings within IntelliJ IDEA Ultimate 2017.2.6
Click Modules > [+] > Import Module
Find build.sbt within project root
Import with default SBT settings:
Download: [checked] Library sources, [checked] SBT source
[unchecked] Use SBT shell for build and import (requires sbt 0.13.5+)
Project JDK: [9.0 (java version 9.0.1)] -- Could this be the problem? (compatibility)
SBT compiles and I get this error, which I somewhat dismissed but reading it now seems to be somewhat telltale but I am unsure of what: https://pastebin.com/tXbHQdek
Running the site works, using sbt run, but when opening .java sources, IntelliJ marks errors upon import play.mvc.* though import views.html.* works fine. Adding framework support for Play 2.x seems to do next to nothing, as no project settings seem to change, and the error is not resolved.
This behavior exists with a clean IntelliJ 2017 Ultimate install (as of today) and an example project from Play Framework with no modifications, so if a solution cannot be found I'll probably consider posting an issue on one or more of their issue trackers.
Any ideas on how to get my Play Framework development environment working?
Thanks :3
This did not originally occur to me but in my search through the Play Framework Google group, I found a suggestion on a somewhat recent post to uninstall Java 9 as Play's dependencies are not yet compatible with it and hence won't resolve.
For anyone who might come across this issue, hopefully this saves you some days headbanging:
Optional - Uninstall JDK and JRE 9
Install JDK 8 (comes with JRE)
From within IntelliJ, File > Project Structure > SDKs > [any Java 9 JDK] > [-]
[+] > `Find your JDK 8 installation folder
32 bit: C:/Program Files (x86)/Java/jdk****/
64 bit: C:/Program Files/Java/jdk****/
Where **** is your Java version, such as 1.8_152, as in jdk1.8_152
Press OK. You'll get a warning that the project SDK is missing or similar, so click the link it provides you to configure that and select your newly configured JDK.
Everything should work from there, just straight away after IntelliJ indexes, which can be tracked in the bottom right corner as with all other operation progress.

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

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.

IntelliJ Run Configuration Broken by an Incompatible Plugin I Can't Uninstall?

I had been developing an application on a trial version of IntelliJ 2016 Ultimate. Since the trial version ran out, I resumed work using the Community Edition. However, trying to launch my application yielded the following error:
Unknown run configuration type #com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory
"No problem" I thought, just an incompatible plugin that was installed with Ultimate that I don't really need anyway. I opened the Plugins section of the Preferences menu, but I can't find the plugin in question. Below is a partial screenshot of the plugin list where I would expect to see the plugin listed in the error message.
The configuration can also not be edited from the Run/Debug Configurations menu, but lists the Run Configuration error as: "Broken configuration due to unavailable plugin or invalid configuration data."
Am I really unable to uninstall the Ultimate plugin preventing my run configuration from working from the Community Edition? What can I do to fix this if so?
It's have been a long time since this question was launched but it might be useful for new searches.
I got the same error with Dart and Flutter.
Just go to Menu >> File >> Settings. Then type plugins on the search box. Check if your plugins need to be updated (in my case Dart and Flutter). I the screenshot I had clicked in the "update" green button. So it turns into "Restart IDE" text. It should fix the problem once you restart the IDE.
To the best of my knowledge the community edition of IDEA will not load and run plugins that are not compatible with it. Moreover, by default, the community edition uses a different configuration directory than the Ultimate edition. So unless you modified the config directory to use, the community version should not be picking up the Ultimate Edition's plugins. Based on the error you show, I think the issue is you simply need to delete that Run configuration. The error is saying that that Run configuration wants to use a Plugin (The Tomcat Plugin) that is not available (i.e. not installed).
If you still want to confirm what plugins are installed, you can manually uninstall a plugin by removing it from the plugins directory. Note that some plugins are simply a standalone JAR, in the plugins directory, others are sub-directories within the plugins directory. Just delete the JAR or sub-directory.
That plugins directory is the idea config directory. See Directories used by the IDE to store settings, caches, plugins and logs for information on its location. On windows for example, by default it will be:
Ultimate: C:\Users\UserName\.IntelliJIdea2016\config\plugins
Community: C:\Users\UserName\..IdeaIC2016\config\plugins
UPDATE
I forgot to mention... bundled plugins are in ${idea-install-directory}/plugins. So for the ultimate edition, the Tomcat plugin is in ${idea-install-directory}/plugins/Tomcat. That is why, as you mentioned in your comment below, you are not seeing that plugin in the user installed plugin directory I mentioned above.
updating flutter and android studio worked in my
case
Simple upgrade Dart plugin..
Go to Settings/Plugins/Browse Repositories and search dart (Language) and upgrade
this will work.
I had a similar worded issue "Run Configuration Error: Broken configuration due to unavailable plugin or invalid configuration data."
In the bottom right part of the Rider IDE, you will see a popup that says
"Plugin supporting feature (Run Configuration[UNITY_ATTACH_AND_PLAY]) is currently disabled."
Click enable plugins, and restart when Rider asks you to do so.
If this does not work, remember that one possible reason is the issues with macOS indexing (my Macbook started to malfunction after its battery hit 0). A way to check is to try and search a file from the top right corner(). If you can not find existing files, this means macOS messed up with indexing.
To solve it, click Apple icon on top left side and go to System Preferences -> Spotlight -> Privacy Tab -> Add all folders to the "won't index" box -> Remove everything you have added so they get reindexed.
https://www.techradar.com/how-to/software/operating-systems/how-to-fix-a-mac-s-broken-find-function-1298964
Lastly, go to Rider and hit File -> Invalidate Caches and Restart.

Unable to to load Tomcat plugin in IntelliJ

I am running IntelliJ 15 Ultimate and trying to enable the Tomcat plugin (which for some reason was disabled). However, IntelliJ does not seem to let me re-enable it.
What I have tried is
Re-install IntelliJ 15, and I chose to replace the old version, but the problems with the plugin seem to be persistent
Deleting /Applications/IntelliJ IDEA 15.app/Contents/plugins/Tomcat between the re-installs to ensure it was not being re-used, but with no avail
Verifying that I have a licensed/paid version of IntelliJ 15 Ultimate edition
At this point I'm not sure what to do, as a re-install clearly did not work. Are there any directories or files I could manually change/remove?
I am using OS X version 10.11.2 is that matters.
You need to enable the "Java EE: EJB, JPA, Servlets" plugin as well. The message is displayed because that plugin is not enabled, and the Tomcat plugin depends on it.
The only solution I could come up with was to entirely wipe IntelliJ and any config files it created as described in this answer.
Upon installing IntelliJ once again, the Tomcat plugin was enabled and was able to create a run configuration for that! Maybe not a fix per se, but it works as expected again.

IntelliJ IDEA 15 Ultimate, Other Settings missing from Settings window

I recently upgraded from IntelliJ 14 to 15 ultimate and I realized I can no longer configure checkstyles as Other Settings in setting window is completely missing.
I cannot understand what I did wrong, and I am not sure if it's some configuration missing to get this Other Settings back.
Exact version : IntelliJ Ultimate 15.0.1
Here is how it looks:
What I tried:
Well I tried searching if there is a way to bring it back, but no luck yet. my colleague is using same version and he can see it. So may be during importing some settings or default configuration from IntelliJ 14, something went wrong.
This happened on an EAP build of Intellij 15:
Solution 1
I had the same issue after upgrade. For me the fix was simply to uninstall Checkstyle-IDEA, restart Intellij and then install it again after which I was able to see: Refer here for doing the same : IntelliJ Installing Plugins
Solution 2
If a restart does not fix your problem, I would recommend a manual cleanup. Steps to do so:
Uninstall Checkstyle-IDEA plugin from within Intellij
Close Intellij and remove the Checkstyle-IDEA directory from the plugins folder. The location of the plugins folder depends on the OS and is documented here : https://devnet.jetbrains.com/docs/DOC-181 For example: Windows: <SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\config\plugins OSX: ~/Library/Application Support/IntelliJIdeaXX
Re-install the plugin and (after a restart) check if you can see the 'Other Settings' -> 'Checkstyle' section again.
Suggestion
Also, I am tempted to suggest that it might be worth seeing if the 'Other Settings' section appears when you install a plugin like 'Grep Console' which puts it's settings there: