While running a corDapp(corDapp-example) for the first time using Kotlin-source, the IntelliJ throws this error - "error Class 'com.example.NodeDriverKt' not found in module 'cordapp-example". I looked for this class in my project structure and I can see a file named NodeDriver.kt which contains a function "main" but I could not see any class declaration. Any solution to remove this error would be much appreciated.IntelliJ
-
Could you post the full log output. I have had a similar issue before which was caused by the devkeys file not being found. – Raymond Mogg Apr 9 '18 at 2:01
i had this same problem with the example cordapp. I was able to resolve this problem by deleting the build and gradle folders in my project, and then, opening the jet brains IDE back again. This restarted the process of installing the gradle. Then the configurations file were set the right way. Previously all the class paths were not there. Have a look on my new configuration of kotlin that was preset after performing the above step. "Use Classpath of module" now is com.example.workflows-kotlin.test =>
I hope this helps :)
A Kotlin file called FileName.kt
with a main
method is compiled into a JVM class called FileNameKt
. So the NodeDriverKt
class is generated when the Kotlin main
method in NodeDriver.kt
is compiled into a JVM class.
This appears to be an IntelliJ caching issue. Try deleting the Run Example CorDapp - Kotlin
run configuration (even if you are not using it directly to run the driver.
Solution 1 : It is a problem centric to 'Caching issue' of IntelliJ IDE. Open menu: File
and hit Invalidate Caches / Restart...
.
Solution 2 : If the problem still persists then remove the gradle folder from the project and close the project and after opening the IDE ,it will setup the gradle again.And it will solve the issue. While debugging the application,now you will be able to see the class path.
-
The cache invalidation removed the Kotlin configuration somehow, which got my IDE into worse conditions than it was before=/ – Ikar Pohorský Sep 6 '19 at 7:55