Plugin building fails for IDEA 2020.1 EAP (plugin requires "com.intellij.modules.python-core-capable" plugin)

Answered

I just updated my plugin project so that it's build against IDEA 2020.1 EAP.  However,

./gradlew buildPlugin 

fails with the following error:

2020-02-11 21:33:47,279 [ 1237] ERROR - llij.ide.plugins.PluginManager - Problems found loading plugins:
The Python Community Edition (id=PythonCore, path=~/programmierung/java/intellij-plugins/intellij-postfix-templates/.sandbox/plugins/python-ce, version=201.4865.17) plugin requires "com.intellij.modules.python-core-capable" plugin to be installed
java.lang.Throwable: Problems found loading plugins:
The Python Community Edition (id=PythonCore, path=~/programmierung/java/intellij-plugins/intellij-postfix-templates/.sandbox/plugins/python-ce, version=201.4865.17) plugin requires "com.intellij.modules.python-core-capable" plugin to be installed

How can I manually install com.intellij.modules.python-core-capable or include it in the build configuration?

10 comments
Comment actions Permalink

zolotov Thanks for your explanations.  You're right.  I also get this exception when I open the Code Folding settings.  I debugged it and found that ScalaCodeFoldingOptionsProvider.this.getTitle() is called at some point which returns null and that leads later to the NullPointerException.

1
Comment actions Permalink

Hello Stefan,

I'd like to start with a couple of suggestions that you should apply in your plugin:

1. Update org.jetbrains.intellij plugin to 0.4.16

2. Use JavaVersion.VERSION_1_8 instead of 1_9

3. Some of the defined dependencies are already bundled in the SDK, so there is no need to attach them again (which causes plugin package to be bigger). I.e.

jackson-databind

4. Do not duplicate the depends entries that refer to the same config-file:

<depends optional="true" config-file="withGoModule.xml">com.intellij.modules.go-capable</depends>
<depends optional="true" config-file="withGoModule.xml">org.jetbrains.plugins.go</depends>

 

Regarding the com.intellij.modules.python-core-capable module - what's the reason for adding that dependency? If you just want to limit some of the extensions i.e. just to PyCharm, please stick to the com.intellij.modules.python

Ref: https://www.jetbrains.org/intellij/sdk/docs/products/pycharm.html

0
Comment actions Permalink

Thanks for the tips, Jakub.

1. Updating the gradle intellij plugin solved already a problem (gradle could not download the IDE).

2. I'm using 1_8 now.

3. Removing jackson-databind did not work although I used the same version for jackson.dataformat as IDEA (2.10.2).  Since I got this exception I included jackson-databind as dependency again:

java.lang.LinkageError: loader constraint violation: when resolving method 'void com.fasterxml.jackson.databind.ObjectMapper.<init>(com.fasterxml.jackson.core.JsonFactory)' the class loader com.intellij.ide.plugins.cl.PluginClassLoader @45da0aaa of the current class, de/endrullis/idea/postfixtemplates/settings/WebTemplateFileLoader, and the class loader com.intellij.util.lang.UrlClassLoader @4f933fd1 for the method's defining class, com/fasterxml/jackson/databind/ObjectMapper, have different Class objects for the type com/fasterxml/jackson/core/JsonFactory used in the signature (de.endrullis.idea.postfixtemplates.settings.WebTemplateFileLoader is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @45da0aaa, parent loader 'bootstrap'; com.fasterxml.jackson.databind.ObjectMapper is in unnamed module of loader com.intellij.util.lang.UrlClassLoader @4f933fd1, parent loader 'platform')
at de.endrullis.idea.postfixtemplates.settings.WebTemplateFileLoader.load(WebTemplateFileLoader.java:17)
at de.endrullis.idea.postfixtemplates.utils.CptUpdateUtils$1.run(CptUpdateUtils.java:79)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:903)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:162)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:600)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:546)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:149)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:417)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:210)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:417)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:243)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

4. I removed all *-capable dependencies. I'm not sure why I added them in the first place.

 

Although we could remove several issues the plugin still does not compile (buildSearchableOptions fails):

% ./gradlew buildPlugin

> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :buildSearchableOptions
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.ide.IdeEventQueue to constructor sun.awt.PostEventQueue(java.awt.EventQueue)
WARNING: Please consider reporting this to the maintainers of com.intellij.ide.IdeEventQueue
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-02-12 14:40:28,378 [ 1600] WARN - ugins.IdeaPluginDescriptorImpl - Resource bundle redefinition for plugin 'org.intellij.scala'. Old value: org.jetbrains.plugins.scala.ScalaBundle, new value: messages.ScalaCodeInsightBundle
2020-02-12 14:40:28,382 [ 1604] WARN - ugins.IdeaPluginDescriptorImpl - Resource bundle redefinition for plugin 'org.intellij.scala'. Old value: messages.ScalaCodeInsightBundle, new value: messages.ScalaConversionBundle
2020-02-12 14:40:28,382 [ 1604] WARN - ugins.IdeaPluginDescriptorImpl - Resource bundle redefinition for plugin 'org.intellij.scala'. Old value: messages.ScalaConversionBundle, new value: messages.ScalaUastBundle
2020-02-12 14:40:28,382 [ 1604] WARN - ugins.IdeaPluginDescriptorImpl - Resource bundle redefinition for plugin 'org.intellij.scala'. Old value: messages.ScalaUastBundle, new value: messages.WorksheetBundle
Starting searchable options index builder
2020-02-12 14:40:34,057 [ 7279] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
2020-02-12 14:40:38,295 [ 11517] WARN - r.PlatformComponentManagerImpl - Do not use constructor injection (requestorClass=com.android.tools.idea.sdk.AndroidSdks)
Searchable options index builder failed
java.lang.NullPointerException
at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469)
at java.base/java.util.TimSort.binarySort(TimSort.java:296)
at java.base/java.util.TimSort.sort(TimSort.java:221)
at java.base/java.util.Arrays.sort(Arrays.java:1515)
at java.base/java.util.ArrayList.sort(ArrayList.java:1749)
at com.intellij.util.containers.JBIterable.sort(JBIterable.java:821)
at com.intellij.application.options.editor.CodeFoldingConfigurable.createComponent(CodeFoldingConfigurable.java:56)
at com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:164)
at com.intellij.ide.ui.search.SearchUtil.processConfigurables(SearchUtil.java:77)
at com.intellij.ide.ui.search.SearchUtil.processProjectConfigurables(SearchUtil.java:49)
at com.intellij.ide.ui.search.TraverseUIStarter.startup(TraverseUIStarter.java:98)
at com.intellij.ide.ui.search.TraverseUIStarter.main(TraverseUIStarter.java:81)
at com.intellij.idea.ApplicationLoader$startApp$8$1.run(ApplicationLoader.kt:238)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
at com.intellij.idea.ApplicationLoader$startApp$8.run(ApplicationLoader.kt:237)
at java.base/java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:783)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:933)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:806)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:433)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:713)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:432)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

> Task :buildSearchableOptions FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSearchableOptions'.
> Process 'command '/home/stefan/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbr-11_0_6-linux-x64-b702.1/jbr/bin/java'' finished with non-zero exit value 255

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 24s
0
Comment actions Permalink

But maybe I better direct this issue to https://github.com/JetBrains/gradle-intellij-plugin, since IDEA itself is able to build and run the plugin, only the gradle-intellij-plugin fails.

0
Comment actions Permalink

I'm lost in the thread. What's the question exactly?

The Python Community Edition (id=PythonCore)

Python CE is not compatible with IDEA Ultimate and cannot be installed there, it's quite expected.

0
Comment actions Permalink

If the question is about this exception:

2020-02-12 14:40:38,295 [ 11517] WARN - r.PlatformComponentManagerImpl - Do not use constructor injection (requestorClass=com.android.tools.idea.sdk.AndroidSdks) 
Searchable options index builder failed
java.lang.NullPointerException
at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469)
at java.base/java.util.TimSort.binarySort(TimSort.java:296)
at java.base/java.util.TimSort.sort(TimSort.java:221)
at java.base/java.util.Arrays.sort(Arrays.java:1515)
at java.base/java.util.ArrayList.sort(ArrayList.java:1749)
at com.intellij.util.containers.JBIterable.sort(JBIterable.java:821)
at com.intellij.application.options.editor.CodeFoldingConfigurable.createComponent(CodeFoldingConfigurable.java:56)

Then the problem is in `CodeFoldingConfigurable` apparently. Likely in one of the extensions came from plugins. It has nothing to do with gradle-intellij-plugin and likely you'll get the very same exception if you open Code Folding settings in the debug instance of the IDE.

You can easily debug `buildSearchableOption` to find the source of the exception, or just disable this task if you need searchable index prepared for your plugin

0
Comment actions Permalink

Thanks for the update. I'll notify Scala team about it

0

Please sign in to leave a comment.