Using #Slf4j Annotation from lombok, but still have error that method log is unknown - intellij-idea

I have a very strange behaviour of Intellij.
I had a single project before, I converted it to a multi module pom and everything seemd to work.
But now I see in my sourcecode the error, that the method log is undefined in spite of the fact that I have annotated the class with #Slf4j from lombok.
And the strange thing is, that I'm able to compile and run the project and I see all the log messages. but I still see this error shown in IntelliJ.
Look at my screenshot:
enter image description here

hmm, no unfortunatly deleting the cashes doesn't solve the problem.
But I finally solved it.
I have done two things (so I dont know if both were required ^^):
I activated the "enable the annotation processing"
I installed the Lombok Plug in and activated all options (Builder Support and so on

Related

Kotlin Multiplatform issue : Type 'org.gradle.api.tasks.Copy' property 'sign' doesn't have a configured value

I am trying to build a KMM project everything works fine in Android also in iOS simulator but when I connect an iOS device I get the below error .
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ':shared:embedAndSignAppleFrameworkForXcode' (type 'Copy').
Type 'org.gradle.api.tasks.Copy' property 'sign' doesn't have a configured value.
Reason: This property isn't marked as optional and no value has been configured.
Possible solutions:
Assign a value to 'sign'.
Mark property 'sign' as optional.
Please refer to https://docs.gradle.org/7.4.1/userguide/validation_problems.html#value_not_set for more details about this problem.
My gradle wrapper properties has 7.4.1, I have used 7.2 version as well same issue.
If anyone can tell me how to resolve this gradle issue to get the framework library ready for iOS project it will be very helpful thanks.
Meanwhile I ll try to figure out myself will update if I find any solution.
Looks like you are missing EXPANDED_CODE_SIGN_IDENTITY. Xcode sets this variable if you select an iOS device. For a simulator In my case, it sets it to -.
Kotlin multiplatform plugin requires this variable to be set for embedAndSignAppleFrameworkForXcode to work properly here.
I think updating Xcode may help. alternatively, you can set EXPANDED_CODE_SIGN_IDENTITY to - if it is not defined.
To do this just update your run script phase:
: "${EXPANDED_CODE_SIGN_IDENTITY:=-}"
./gradlew :shared:embedAndSignAppleFrameworkForXcode
Hopefully, it will help.
The answer is that you need go to 'Build Settings' -> 'Code Signing Identify' and make sure that you have a signing certificate set. You'll need to make sure you have a Team selected in 'Signing & Capabilities' as well.

How do I get IntelliJ to make code completion suggestions from other files in the package?

For example, if I have a file (example is Kotlin):
package app
enum class Resources {
Gold,
Wood,
Food
}
How can I make IntelliJ suggest Resources.Gold, Resources.Wood, and Resources.Food in another file? It was doing this for me at one point but for some reason it has suddenly stopped. I can't find anything about it in the Code Completion settings and nothing changed when I reinstalled IntelliJ nor when I restarted my computer.
Here is a screenshot of my IDE where I expect code completion (line 29):
Thanks in advance!

Configuring UnetStack in Intellij IDEA

I'm trying to use IntelliJ IDEA for my UnetStack Project.
I'm following this blog
https://blog.unetstack.net/using-idea-with-unetstack
I get this error when done following this:
Error: Could not find or load main class org.codehaus.groovy.tools.GroovyStarter
I had the same issue.
This happened to you because you ran your simulation as a groovy script and not as the configured application. Run it as application and groovyStarter will not even be used.

Instrumentation Error even if already Instrumented. (Standalone Instrumentation, using CaptainCasa Framework)

Even if Eclipse already said that class is instrumented, when I click "Reload Server" on CaptainCasa toolset, error occurs
org.javalite.activejdbc.InitException: you are trying to work with models, but no models are found. Maybe you have no models in project, or you did not instrument the models. It is expected that you have a file activejdbc_models.properties on classpath...
Here is the Instrumentation message from Eclipse.
Here is the error to make it more detailed.
the only reason for you to see this error is when your models are not instrumented. It is possible that your framework or an IDE wipes instrumented models and replaces them with non-instrumented.The message is self-explanatory.

Kotlin - Error: Could not find or load main class _DefaultPackage

I followed the Kotlin tutorial for eclipse here : Getting Started With Eclipse Luna
However, I'm running into this error:
Error: Could not find or load main class _DefaultPackage
Anyone who knows to get around this?
This was a severe bug (KT-10221) in automatic generation of Launch Configuration in plugin version 0.4.0. It was fixed in 0.5.0 so the recommendend way to workaround is to update plugin.
The source of the problem was that the plugin used an old pattern for generating name of the class for main function that had been abandoned by Kotlin compiler.
It's possible to workaround it by editing launch configuration (Eclipse Menu -> Run -> Run Configurations...) by hand and changing Main class field in Java Application group. If the file is named hello.kt with no package directive, as it is described in tutorial, than corrected string should be HelloKt.
If file has name other.kt with package my.tutorial than the Main Class should contain my.tutorial.HelloKt. You can read more about it in the section Package-Level Functions of Calling Kotlin From Java page.
I have been getting the same issue. And after putting the right compiler output path, it got resolved.
Go to Project -> Project Compiler output :
In the text box, fill this:
[Absolute Path]/{Project Name}/out
In my case I was having this problem while trying to run the program using the Application Gradle plugin. The problem was in the mainClassName property using single quotes instead of double ones
This didn't work:
mainClassName = 'demo.HelloWorldKt'
With double quotes, it works:
mainClassName = "demo.HelloWorldKt"
For me it worked after I installed the correct JDK. I first had JDK 11 but the tutorial I did was with JDK 8 so after I installed this and set it in the "installed JREs" options it found the main class without having any "mainClassName" or any other option in the build.gradle file.
For me, it worked in a fresh eclipse workspace. Possibly, the Kotlin eclipse plugin is not playing well with other plugins (in my case, PyDev).
I'm creating a Kotlin Application with JavaFX and I had this issue until I went to:
Run > Run Configurations > Java Application > Common
I unticked "Allocate console" and it fixed the issue.