Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not delete caches dir when compile Kotlin in Intellij IDE

My project use plugin kapt to generate mapper.

When run app then can not compile Kotlin (image below) If remove plugin kapt then it not happend. To resolve I must restart Intellij IDE. Take more time.

This error probably only happen on windows enter image description here

like image 759
Phan Kieu Hung Avatar asked Dec 30 '22 21:12

Phan Kieu Hung


2 Answers

This is a Kotlin bug, you can vote and watch it for updates: https://youtrack.jetbrains.com/issue/KT-36253. A workaround is to kill the running Java processes.

like image 198
Alexey Belkov Avatar answered Jan 04 '23 17:01

Alexey Belkov


I have this problem almost every build (Android Studio stable + Artic Fox).

Manual Solution (try this first, if it works continue)

Task manager > Processes > End "OpenJDK Platform Library" tasks (sometimes it's standalone, sometimes it's under "Android Studio")

OR

Task manager > Details > End "java.exe" tasks

Automated Solution

  1. Create a new end-java.bat file
  2. Content of .bat file: taskkill /f /IM java.exe
  3. Right click end-java.bat file > create shortcut
  4. Right click the shortcut > properties
  5. Add shortcut key (e.g. ALT + CTRL + 1)
  6. ALT + CTRL + 1 will now fix the issue
like image 40
Ferdau Avatar answered Jan 04 '23 16:01

Ferdau