on macOS and idea2023.2.3, plugin init toolwindow failed: w and h must be > 0
I have developed an idea plugin, after installing it in ideaIC-2023.2.3 on macOS, it reports an initialization error: "Cannot init toolwindow". However, on Windows, this version of idea can install and run the plugin normally, and on macOS, ideaIC-2023.1.x and earlier versions can also install and run the plugin normally. The error log does not mention any code related to the plugin, but only the code of the plugin development platform. How should the plugin be adjusted to adapt to ideaIC-2023.2.x? Here is the error log:
com.intellij.diagnostic.PluginException: Cannot init toolwindow com.sc.intellij.window.CodeShellWindowFactory@1549569a [Plugin: com.sc.intellij.codeshell-intellij-plugin]
at com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:191)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.access$registerToolWindows(ToolWindowSetInitializer.kt:1)
at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt:129)
at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt:121)
at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:248)
at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:199)
at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1.invokeSuspend(ToolWindowSetInitializer.kt:121)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:193)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:690)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:593)
at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:997)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:997)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.lang.IllegalArgumentException: w and h must be > 0
at java.desktop/java.awt.image.Raster.createInterleavedRaster(Raster.java:214)
at java.desktop/java.awt.image.ComponentColorModel.createCompatibleWritableRaster(ComponentColorModel.java:2827)
at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:420)
at com.github.weisj.jsvg.v.b(SourceFile:9059)
at com.github.weisj.jsvg.da.a(SourceFile:91)
at com.github.weisj.jsvg.aU.a(SourceFile:91)
at com.github.weisj.jsvg.cP.a(SourceFile:127)
at com.github.weisj.jsvg.br.a(SourceFile:1093)
at com.github.weisj.jsvg.br.a(SourceFile:1094)
at com.github.weisj.jsvg.br.a(SourceFile:1094)
at com.github.weisj.jsvg.br.a(SourceFile:1094)
at com.github.weisj.jsvg.bp.a(SourceFile:141)
at com.github.weisj.jsvg.nodes.SVG.renderWithSize(SourceFile:135)
at com.intellij.ui.svg.JsvgKt.renderSvgWithSize(jsvg.kt:46)
at com.intellij.ui.svg.JsvgKt.renderSvg(jsvg.kt:19)
at com.intellij.ui.svg.JsvgKt.renderSvg$default(jsvg.kt:10)
at com.intellij.ui.svg.SvgKt.renderImage(svg.kt:309)
at com.intellij.ui.svg.SvgKt.renderAndCache-rdQnj48(svg.kt:261)
at com.intellij.ui.svg.SvgKt.access$renderAndCache-rdQnj48(svg.kt:1)
at com.intellij.ui.svg.SvgKt.loadSvgAndCacheIfApplicable-F6nGey4(svg.kt:590)
at com.intellij.ui.icons.ImageCacheKt.doLoadByDescriptor(imageCache.kt:290)
at com.intellij.ui.icons.ImageCacheKt.loadByDescriptorWithoutCache(imageCache.kt:177)
at com.intellij.ui.icons.ImageCacheKt.loadImage(imageCache.kt:139)
at com.intellij.ui.icons.ImageDataByPathResourceLoader.loadImage(ImageDataByUrlLoader.kt:65)
at com.intellij.ui.icons.CachedImageIcon.loadImage$intellij_platform_util_ui(CachedImageIcon.kt:313)
at com.intellij.ui.icons.ScaledIconCache.getOrScaleIcon(ScaledIconCache.kt:43)
at com.intellij.ui.icons.CachedImageIcon.resolveActualIcon(CachedImageIcon.kt:158)
at com.intellij.ui.icons.CachedImageIcon.getIconWidth(CachedImageIcon.kt:119)
at com.intellij.openapi.wm.impl.ToolWindowIcon.getIconWidth(ToolWindowIcon.kt:32)
at com.intellij.ide.actions.ActivateToolWindowAction.updatePresentation(ActivateToolWindowAction.java:113)
at com.intellij.ide.actions.ActivateToolWindowAction.ensureToolWindowActionRegistered(ActivateToolWindowAction.java:52)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1100)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:181)
Please sign in to leave a comment.
I have encountered an issue where the component length and width are set to -1 in the configuration window, which has caused an error. In previous versions of idea, -1 was automatically set for length and width.
It looks like a bug.
Please report on https://youtrack.jetbrains.com/issues/IDEA with detailed information (ideally, a minimal test plugin) and steps to reproduce.