Is there any limitation on which IntelliJ version I can use?

Answered

I'm trying to start developing a new plugin. I started from the Gradle template provided in the docs: https://github.com/JetBrains/intellij-platform-plugin-template 

Clone the repo, modify it a bit, start the IDE. Works great, nice. Change something in the plugin's code, then run the buildPlugin Gradle task. The sandbox ide will correctly reload and show the changes.

But the IntelliJ IDEA Community version in it is a year old:

platformVersion = 2020.3.4

So maybe I should change that to a newer one. Let's say 2021.3.1 or any other 2021.x version.

https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties I don't see anything in the linked docs about this new version would be unusable/incompatibile. This should work, right?

I changed the version, synced the project, restarted the sandbox IDE. Now if I run the buildPlugin task, it fails with an error:

Execution failed for task ':prepareSandbox'.

> Could not copy file 'C:\Develop\temporary\intellij-plugin-test\build\libs\intellij-plugin-test-0.0.1.jar' to 'C:\Develop\temporary\intellij-plugin-test\build\idea-sandbox\plugins\intellij-plugin-test\lib\intellij-plugin-test-0.0.1.jar'.

The requested operation cannot be performed on a file with a user-mapped section open.

If I change back the version to 2020.3.4, and start the test again, the buildPlugin finishes without problem, so it's not about wrong cached files or something like that.

I wonder if this is a bug or just I'm trying to use an IDE version which is somehow not supported for plugin development?

5 comments
Comment actions Permalink

This should work.
It feels like the file is accessed by some other process. Try restarting your PC and see if it works again.

0
Comment actions Permalink

That doesn't help. I already tried this multiple times in the last week, also creating different project in a fresh directory (that no other process should access), global and local gradle caches, build directories removed, recloned the template, ect. Only changing back the version number to 2020.x solves the problem.

0
Comment actions Permalink

Please try removing the sandbox directory after changing the target IDE platform version to make sure to start with fresh configuration files. https://plugins.jetbrains.com/docs/intellij/ide-development-instance.html#the-development-instance-sandbox-directory

0
Comment actions Permalink

As I said I already did that multiple times.

Build directories are removed, same error happened. I also created new projects (which means a new sandbox directory is created), didn't work. In the recent days I also reinstalled my PC, meaning all cached files are wiped. After recloning the project (which did not include build dirs nor .gradle or other cache dirs), the same error still remained.

0
Comment actions Permalink

Hi Klenium2,

The answer to your question is that there is no limit of a platform version you can use here. I've tested the scenario you described and it works as expected on MacOS.

Googling for:
"The requested operation cannot be performed on a file with a user-mapped section open."

shows that the error is about file being locked by another process/thread and is Windows-specific. It may be related to Java issues or anti-virus protection:
https://stackoverflow.com/questions/38377569/android-gradle-mergeresources-failed-with-user-mapped-section-opened

It's hard to know what's the actual issue in your case, but I suggest checking anti-virus, updating Java, and googling around for other possible solutions if it still doesn't work. It seems to be the system issue, not the template/project issue.

0

Please sign in to leave a comment.