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:
- 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.
- 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.
- 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
- Do not define dynamic errors, use wrapped static errors instead
- Reducer is a required argument, and must be a function or an object of functions that can be passed to combinereducers
- Error: dialect needs to be explicitly supplied as of v4.0.0
- Descriptor ‘append’ for ‘list’ objects doesn’t apply to a ‘int’ object