Detected multiple kotlin daemon sessions at build/kotlin/sessions

When you encounter the error message “Detected multiple Kotlin daemon sessions at build/kotlin/sessions,” it means that there are multiple instances of the Kotlin daemon running simultaneously. This typically happens when you have multiple Gradle builds running in parallel or when there are leftover Kotlin daemon processes from previous builds.

To resolve this issue, you have a few options:

  1. Wait for the existing processes to complete: If you have multiple Gradle builds running in parallel, you can simply wait for the ongoing builds to finish. Once the current Kotlin daemon processes finish, you can run the build again without encountering this error.
  2. Restart your machine: If waiting doesn’t solve the problem, you can try restarting your machine. This will terminate all existing Kotlin daemon processes and provide a clean start for your build.
  3. Manually stop the Kotlin daemon processes: If the previous steps didn’t work or are not feasible for your situation, you can manually stop the Kotlin daemon processes. Here’s how you can do it:

  $ pkill -f "kotlin-compiler-daemon"
  

This command will terminate all Kotlin daemon processes running on your machine. Once you’ve stopped the processes, you can run your build again without encountering the error.

Example:


  $ pkill -f "kotlin-compiler-daemon"

  # Output
  Kotlin daemon processes terminated.
  

By following one of the above methods, you should be able to resolve the “Detected multiple Kotlin daemon sessions” error and continue with your build process.

Same cateogry post

Leave a comment