Dynamic reloading on kotlin plugins

I have created a new plugin from the intellij-platform-plugin-template in GitHub and did no relevant changes to it.

I want this to be a Dynamic plugin, so I can use Auto-reload to reduce iteration cycle times.

To try auto-reloading I do:

  • Use the built-in “Run Plugin” configuration. It calls gradle runIde. Run, not debug.
  • Run a new configuration that calls gradle buildPlugin

Which makes buildPlugin fail in the prepareSandbox step. Check attached log

I looked with powertoys’s File Locksmith, and it tells me that Java.exe has the file (which is the sandboxed pycharm instance).

Additional things I tried but didn’t work:

  • I saw in the Auto-reload page that buildSearchableOptions needs to be set to false.
  • Disabled Plugin DevKit, since I’m not using it, in case that was conflicting somehow.
  • Removed toolWindow from plugin.xml, in case that was not a dynamic extension.
  • Tried reverting using Pycharm to let it use IDEA instead.

In case it’s related, I’m using IntelliJ IDEA 2024.3.4.1 (Ultimate Edition), Build #IU-243.25659.59, built on March 5, 2025

Relevant log output or stack trace

Execution failed for task ‘:prepareSandbox’. > Could not copy file ‘C:\Users\metalbass\MemoryGrapher\build\libs\MemoryGrapher-0.0.1.jar’ to ‘C:\Users\metalbass\MemoryGrapher\build\idea-sandbox\PC-2024.3.2\plugins\MemoryGrapher\lib\MemoryGrapher-0.0.1.jar’. > C:\Users\metalbass\MemoryGrapher\build\idea-sandbox\PC-2024.3.2\plugins\MemoryGrapher\lib\MemoryGrapher-0.0.1.jar (The requested operation cannot be performed on a file with a user-mapped section open)

Steps to reproduce

  • Use this template to create a new project
  • Clone
  • Use the built-in “Run Plugin” configuration. It calls gradle runIde. Run, not debug.
  • Run a new configuration that calls gradle buildPlugin

Gradle IntelliJ Plugin version

243.25659.59

Gradle version

8.10.2

Operating System

Windows 10

1 Like

I have exactly the same problem, and I haven’t found any solution, alas.
I also have a feeling that it may be windows related only

That would be correct. Windows prevents files under usage from being modified.

This (Ultimate-only?) feature, on the other hand, works, albeit only for a few cases (e.g. when a function/method is modified but not new top-level symbols, etc.):

1 Like