IntelliJ Error:Kotlin: Module was compiled - kotlin

I have used IntelliJ IDE just for Spring Boot project. Strong NOTE that I have not used any Kotlin project. But, today, I have an error below. Any professional person. Please, HELP to solve this issue! Thanks,
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.

I ran into the same problem, and my solution was:
If you do not use Kotlin in your project, you can solve the problem by turning off the IntelliJ IDE plugin.The operation is as follows:
idea menu:File>Setting>Plugins
Operation flow chart

According to solution from: https://stackoverflow.com/a/71093698/13248380
Try going to Build menu and choose Rebuild project.

Related

Problem in running a project with aspectJ in IntelliJ IDEA 2022.2.3 (Community Edition)

I am trying to run a project with aspectJ, rather than Java, in IntelliJ IDEA. I had done it before by simply putting "aspectj-1.9.6" in a "Lib" folder and setting the folder "as Library". But I tried it again today and it is not working. I think it might be because I have updated my IntelliJ to version "2022.2.3". I saw in this link that for intelliJ version "2021.1", one should select "ajc" as the project compiler in IntellJ. But it seems that there is no such compiler option in IntelliJ version "2022.2" (as I looked at this link and also searched in this link).
I also tried to install and enable "AspectJ weaver" plugin, but I encounter the following error: "Plugin 'AspectJ weaver' failed to initialize and will be disabled. Please restart IntelliJ IDEA.". Someone has had the same problem in this post, but the answer doesn't work for me, as it refers to this link, which is not compatible with IntelliJ version 2022.2.3:
So, I wonder whether aspectJ is not supported any more in IntelliJ?
Does any one has any suggestion that I could use it with this version of IntelliJ? I do really appreciate any help.
Thanks in advance
IntelliJ IDEA is compatible with AspectJ. I am running the plugin on 2022.2.3 without any problems. But I use IDEA Ultimate, you use Community. Did you notice this in your screenshot?
Compatible with IntelliJ IDEA Ultimate

Intellij-idea Debugger - Coroutine tab : "An error occurred on fetching information"

I'm trying to do some coroutine example represented on : https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-basic-02.kt
and It's debugger not working properly.
As you see, even code about coroutine like 'runBlocking' or 'launch' is not detected by intellisense,
I don't know what is my problem.
First my project is kotlin Console program, and
What I've done to import kotlinx.coroutine to my project are :
at Project Structure, Module downloaded org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC from Maven, when downloading checked Trasitive-something and Source, and added at library.
at Settings -> Build -> Kotlin compiler, changed language version and API version to 1.5, which is experimental version of Kotlin
at Project tool and build.gradle.kts, added
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC") at dependencies,
kotlin("jvm") version "1.5.0" at plugins
Just run projects works well, but I can't use any context menu when using code about coroutine and as you know, it's really annoying me. any help would be appreciated.
I had the same problem but it seems to be fixed in 1.5.0. See https://youtrack.jetbrains.com/issue/KTIJ-11620
I meet this problem today, I use the latest the Coroutine library version and my kotlin version is 1.6.21 which is not the latest.
I just update my kotlin version to the latest version 1.8.10.

Intellij : issue with Mockito library (is it corrupted ?)

I've been using Intellij and Mockito for years with no issue, but I have a problem on one of my Gradle projects where some parts of Mockito are not recognized as expected, which makes it painful to use.
First of all, when I build my project with Gradle from the command line, I don't have any issue, so it seems to really be a problem with Intellij (I am using latest community edition version, 2020.2.3) .
My first issue was that Mockito was not found at all : thinking that the lib was maybe corrupted somehow, I deleted it from gradle cache folder, where it was stored, so that it would get downloaded again.
Now it seems a little bit better : Mockito is found. However, Intellij will not find the thenReturn method on Mockito.when :
When I try to see Mockito's source code, I get this library source code does not match the bytecode, so maybe there's some inconsistency somewhere.. :
I cleared Intellij cache and restarted, but I still have the same issue. I have tried to clone and build the project in another directory (ie another Intellij project), but I have the exact same issue.
I am using Gradle 6.5.
Mockito version that comes is the 3.3.3, through spring-boot-starter-test (I am using the 2.3.5.RELEASE).
If I override this by declaring myself Mockito, in version 3.2.0 for example, then I dont have the problem anymore.
If I upgrade to Spring Boot 2.4.0, then Mockito 3.6.0 comes, and I don't have the problem..
so it seems to really be related to the Mockito 3.3.3 version I am using..
Is there something more I could do ?
I ended up downloading manually the jar from https://repo1.maven.org/maven2/org/mockito/mockito-core/3.3.3/ and replaced the jar that was used by my project in .gradle\caches\modules-2\files-2.1\org.mockito\mockito-core\3.3.3\ , and it seems to be working.
I will do more tests to understand where the corrupted version got download from.

IntelliJ 12 + Gradle 1.3 - Basic Gradle syntax seems non-functional

I am attempting to play around with Gradle integration in IntelliJ Idea (Ultimate) v12.
It seems even if $GRADLE_HOME is configured properly, basic syntax such as 'apply', 'dependencies', etc. is not recognized.
I would seem like the solution should be something simple. Any help is appreciated.
IntelliJ IDEA doesn't currently offer syntax completion for Gradle build scripts. All you get is the standard Groovy support.
I was having the same problem until this morning. I did the following steps and it solved itself:
added the root build.gradle file (we have several) to the JetGradle tab and refreshed
updated to IDEA 12.0.1 (it restarts and reindexes)
I think doing the first one and restarting may be enough, but I'm not sure.
I'm using Intellij 13 and have had similar problems. What I noticed was, creating a new Project from Intellij (i.e. new Groovy Project or Gradle project), I get the syntax error markers. I also have noticed it didn't do a good job pulling in Gradle dependencies.
On the other hand, if I Import a Project through an already created build.gradle file, the syntax error markings go away and the dependencies seem to play more nicely. Not sure if this works for you.
With Intellij 14 and Gradle 2.3 I found that adding {$GRADLE_HOME}/lib and {$GRADLE_HOME}/lib/plugins as libraries in my project settings got rid of all the warnings like "dependencies cannot be applied to groovy.lang.Closure".

How to resolve a conflict in JetGradle on IntelliJ IDEA 11.1.2?

I am new to the Gradle integration JetGradle in IntelliJ IDEA 11.1.2 and currently I ran into a conflict with a compile time dependency.
Currently I do not know how to solve this conflict since IDEA does not provide me more informations than this little screenshot. Do you ran into a similar problem and were able to fix it? Any hints are appreciated.
Update: I have found out that IntelliJ IDEA is somehow unable to attach the joda-time-2.1.jar to the joda-time-2.1 library .
If I then manually add the JAR the conflict is successfully resolved. Is there a way IntelliJ can tell my why it does not add the JAR?
Yes, the problem is that the library is defined either in gradle or IDE but the jar is not attached to it at the IDE side.
AFAI there is no GUI at the IDE side that helps to resolve this situation. Please create a dedicated feature request at the tracker.
Denis