sbt-idea-plugin: Assertion failed: Duplicate bundled template

Answered

I'm starting developing a IntelliJ plugin by Scala, so I used sbt-idea-plugin and sbt-assembly for solving dependency. I run "sbt packagePluginZip" and installed my zipped plugin and the plugin works well.

I tried running an IDE with my plugin being developed. So I executed "sbt ideaRunner/run", but I got the error being written below. I changed assemblyExcludedJars options, ideaBuild version, unmanagedJars, and ideaExternalPlugins... but, I can't.

How should I avoid this error?

The repository used by me is https://github.com/uzimith/easycursor/tree/dcae90c94e0379fcf7ccaec756366a8b4f14c682 and I run "sbt clean updateIdea ideaRunner/run"

2018-11-17 01:13:17,661 [ 43920] ERROR - e.fileTemplates.impl.FTManager - Assertion failed: Duplicate bundled template Singleton.java [jar:file:/Users/uzimith/.easycursorPluginIC/sdk/183.4284.93/lib/java_resources_en.jar!/fileTemplates/Singleton.java.ft, jar:file:/private/var/folders/r3/vw_r84cj4c5209l6h4vrysxh0000gn/T/sbt_72558845/target/e05b8db5/java_resources_en.jar!/fileTemplates/Singleton.java.ft] 
java.lang.Throwable: Assertion failed: Duplicate bundled template Singleton.java [jar:file:/Users/uzimith/.easycursorPluginIC/sdk/183.4284.93/lib/java_resources_en.jar!/fileTemplates/Singleton.java.ft, jar:file:/private/var/folders/r3/vw_r84cj4c5209l6h4vrysxh0000gn/T/sbt_72558845/target/e05b8db5/java_resources_en.jar!/fileTemplates/Singleton.java.ft]
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:174)
at com.intellij.ide.fileTemplates.impl.FTManager.createAndStoreBundledTemplate(FTManager.java:199)
at com.intellij.ide.fileTemplates.impl.FTManager.addDefaultTemplate(FTManager.java:190)
at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.loadDefaultsFromRoot(FileTemplatesLoader.java:193)
at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.loadDefaultTemplates(FileTemplatesLoader.java:152)
at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.<init>(FileTemplatesLoader.java:94)
at com.intellij.ide.fileTemplates.impl.FileTemplateSettings.<init>(FileTemplateSettings.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:85)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.instantiateGuarded(CachingConstructorInjectionComponentAdapter.java:62)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:45)
at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:209)
at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:246)
at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:213)
at org.picocontainer.defaults.BasicComponentParameter.resolveInstance(BasicComponentParameter.java:77)
at org.picocontainer.defaults.ComponentParameter.resolveInstance(ComponentParameter.java:114)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getConstructorArguments(CachingConstructorInjectionComponentAdapter.java:111)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:82)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.instantiateGuarded(CachingConstructorInjectionComponentAdapter.java:62)
at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:45)
at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:209)
at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:246)
at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:213)
at com.intellij.openapi.components.ServiceManager.doGetService(ServiceManager.java:52)
at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:30)
at com.intellij.ide.fileTemplates.FileTemplateManager.getInstance(FileTemplateManager.java:54)
at com.intellij.ide.fileTemplates.actions.CreateFromTemplateGroup.getChildren(CreateFromTemplateGroup.java:66)
at com.intellij.ide.actions.WeighingActionGroup.getAllChildren(WeighingActionGroup.java:44)
at com.intellij.ide.actions.WeighingActionGroup.getAllChildren(WeighingActionGroup.java:50)
at com.intellij.ide.actions.WeighingActionGroup.getChildren(WeighingActionGroup.java:67)
at com.intellij.ide.actions.NewActionGroup.getChildren(NewActionGroup.java:31)
at com.intellij.openapi.actionSystem.impl.Utils.hasChildrenWithState(Utils.java:238)
at com.intellij.openapi.actionSystem.impl.Utils.hasVisibleChildren(Utils.java:219)
at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:165)
at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:177)
at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:177)
at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:295)
at com.intellij.openapi.actionSystem.impl.ActionMenu.fillMenu(ActionMenu.java:282)
at com.intellij.openapi.actionSystem.impl.ActionMenu$MenuListenerImpl.menuSelected(ActionMenu.java:237)
at javax.swing.JMenu.fireMenuSelected(JMenu.java:1038)
at javax.swing.JMenu$MenuChangeListener.stateChanged(JMenu.java:1118)
at javax.swing.DefaultButtonModel.fireStateChanged(DefaultButtonModel.java:349)
at javax.swing.DefaultButtonModel.setSelected(DefaultButtonModel.java:232)
at javax.swing.JMenu.setSelected(JMenu.java:305)
at com.apple.laf.ScreenMenu$2.run(ScreenMenu.java:136)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:668)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2 comments
Comment actions Permalink

Hi!

It seems you're following some outdated examples for setting up your build.
I've created a PR to update it here: https://github.com/uzimith/easycursor/pull/1
You can take a look how we're using sbt to develop a plugin in Scala here: https://github.com/JetBrains/intellij-scala

0
Comment actions Permalink

Hi,

I merged that PR. It works well. Thank you!

0

Please sign in to leave a comment.