Broken compilation in IDE


#1

Something happened in my IDEA and compilation of all (very small) Kotlin projects became very long.
IDEA Community versions: 15.0.2 (current stable), 15.0.3 (eap), 16 (144.2151.16) - all are affected
OS: Win 10, JDK - 1.8.0_66
The cause is listed in the “Messages” window:

Information:Kotlin: Kotlin JPS plugin version 1.0.0-beta-3595-IJ143-32
Information:Kotlin: Plugin loaded: KotlinAndroidJpsPlugin
Information:Kotlin: Using kotlin-home = C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.2\plugins\Kotlin\kotlinc
Information:Kotlin: Falling  back to compilation without daemon due to error: [daemon client] java.lang.Exception: Unable to get response from daemon in 10000 ms

String Falling back to compilation without daemon can be found in KotlinCompilerRunner.kt
String Unable to get response from daemon in KotlinCompilerClient.kt

After 10 sec compilation starts and works fine.

Command line compiler works as it should.
Clearing of ~/.IdeaIC15 doesn’t help

How can I find out what is broken and how can I fix it?


#2

Could you, please, do the following:
go to “Preferences -> Build, Execution, Deployment -> Compiler” and add “-Dkotlin.daemon.verbose” to the “User local VM options”, and try it again.
If the problem will not be obvious from the output then, pleas take the daemon execution command line from Messages, and try run it from cmd.exe.
Please then report here the results.


#3
  1. I set “-Dkotlin.daemon.verbose” in the “User local VM options” at “Settings -> Build, Execution, Deployment -> Compiler”
  2. Pressed “Rebuild Project” in small project
  3. New information in “Messages” has been shown:
Information:Kotlin: [daemon client] no suitable daemon found
Information:Kotlin: [daemon client] starting the daemon as: C:\Program Files\Java\jdk1.8.0_66\jre\bin\java -cp C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.2\plugins\Kotlin\kotlinc\lib\kotlin-compiler.jar -Djava.awt.headless=true -Xmx700m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:\Users\Саша и Аня\AppData\Local\kotlin\daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-verbose --daemon-compilerClasspath C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.2\plugins\Kotlin\kotlinc\lib\kotlin-compiler.jar
Information:Kotlin: [daemon] C:\Users\���� � ���\AppData\Local\kotlin\daemon

But daemon is still inacessible:

Information:Kotlin: Falling  back to compilation without daemon due to error: [daemon client] java.lang.Exception: Unable to get response from daemon in 10000 ms

“���� � ���” is username in Ciryllic - but it seeems that it is not a problem (this is incorrect output only).
I have tried to copy command from “starting the daemon as:” in cmd. Command can not be executed because quotes in file names are absent. Once quotes have been added, the deamon started (from cmd). Then I have tried to rebuild project. OK:

Information:Kotlin: [daemon client] found daemon on port 17741, trying to connect
Information:Kotlin: [daemon client] connected to the daemon

Start from IDE still is impossible.

Anyway, thanks a lot for help. At the least I can build with daemon started independently :slight_smile:
Can you suggest how can I fix IDE build?


#4

Kotlin plugin just updated to

Information:Kotlin: Kotlin JPS plugin version 1.0.0-beta-4584-IJ143-12

The problem is still here


#5

Thank you for your response and sorry for the delay. I will try to reproduce it and issue a fix as soon as possible.


#6

Thank you for workaround, but finally I update Idea, reinstall plugin and clean some settings and compilation repaired. If it appear again I will know workaround and try to find out reasons.


#7

I investigated the problem a bit further and found out that it likely a known JDK problem - http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4947220, which claimed to be fixed in JDK7.
The workaround would be to run IDEA’s builder process on 7+. So setting your project JDK to 7+ should solve the problem.


#8

I am still dealing with this problem, using JDK 8 all the time, exactly the same output


#9

I’m not sure if it’s an appropriate topic to write, but I’ve encountered a very mystical Idea behaviour. Basically something network-related in Idea causes exactly 1-minute pauses. First is startup. Idea’s banner window doesn’t appear for 1 minute, then everything proceeds as usual. Then Kotlin compilation. Every compilation has extra minute, even simplest source change. I’m not sure about Java.

Those things happen in one WiFi network. I think that provider of that network restricts some websites. If I turn on my OpenVPN, everything works good. If I turn it off — mysterious 1 minute delay here and there.

Worse of all — there’s no errors, just 1 minute delay.

I think it’s some network timeout. I tried to track it using tcpdump, but I couldn’t spot any unusual network activity. Though I’m not very good at it and could miss something.

Gradle from terminal works fine.


#10

Reinstalling also fixed it for me, now I’m getting a weird pause after

Information:Kotlin: Plugin loaded: KotlinAndroidJpsPlugin


#11

I solved this by turning off “Keep compiler process alive between invocations” within File -> Settings -> Build, Execution, Deployment -> Compiler -> Kotlin Compiler.