Skip to content

Instantly share code, notes, and snippets.

@kigster
Last active March 2, 2020 23:54
Show Gist options
  • Save kigster/137bac96f42135d20907c8518dc918cb to your computer and use it in GitHub Desktop.
Save kigster/137bac96f42135d20907c8518dc918cb to your computer and use it in GitHub Desktop.
IntelliJ IDEA Ultimate 2019.3.3 + Bazel Plugin — Import Project exception: No SyncPlugin present which provides a default workspace type.

Bazel Plugin Exception when Importing a Project

Steps Involved

  1. Install Plugin (tried two methods, same result — see below)
  2. Restart IDEA
  3. Select Import Bazel Project
  4. Point "workspace" to the folder with the WORKSPACE file.
  5. When asked to create project build file, I tried "create from scratch" and "import from BUILD file" — same result.
  6. I can't seem to move past this stage, and I don't see any other method to enable Bazel support for a project.

IDEA Version:

  • IntelliJ IDEA 2019.3.3 Build #IU-193.6494.35
  • JDK: 11.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
  • OS: Mac OS X
  • Plugin to blame: Bazel version: 9999
  • No SyncPlugin present which provides a default workspace type.

How was the Plugin Installed?

I tried two methods:

  1. Installing it from the Marketplace
  2. Building it on my own using the following:
$ git clone git@github.com:bazelbuild/intellij.git
$ cd intellij
$ docker run -it --rm -v $(pwd):/src/workspace -v /tmp/build_output:/tmp/build_output -w /src/workspace --entrypoint=/bin/bash l.gcr.io/google/bazel:latest
$ bazel --output_user_root=/tmp/build_output build //ijwb:ijwb_bazel_zip --define=ij_product=intellij-ue-2019.3

While running the container:

$ docker cp <docker-id> /tmp/build_output....ijwb_bazel.zip .

Exception

In IDEA log I see the following:

java.lang.IllegalStateException: No SyncPlugin present which provides a default workspace type.
	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
	at com.google.idea.blaze.base.sync.projectview.LanguageSupport.getDefaultWorkspaceType(LanguageSupport.java:47)
	at com.google.idea.blaze.base.projectview.section.sections.AdditionalLanguagesSection$AdditionalLanguagesDefaultValueProvider.availableAdditionalLanguages(AdditionalLanguagesSection.java:105)
	at com.google.idea.blaze.base.projectview.section.sections.AdditionalLanguagesSection$AdditionalLanguagesDefaultValueProvider.addProjectViewDefaultValue(AdditionalLanguagesSection.java:81)
	at com.google.idea.blaze.base.wizard2.ui.BlazeEditProjectViewControl.modifyInitialProjectView(BlazeEditProjectViewControl.java:262)
	at com.google.idea.blaze.base.wizard2.ui.BlazeEditProjectViewControl.init(BlazeEditProjectViewControl.java:275)
	at com.google.idea.blaze.base.wizard2.ui.BlazeEditProjectViewControl.update(BlazeEditProjectViewControl.java:229)
	at com.google.idea.blaze.base.wizard2.ui.BlazeEditProjectViewControl.<init>(BlazeEditProjectViewControl.java:134)
	at com.google.idea.blaze.base.wizard2.BlazeEditProjectViewImportWizardStep.init(BlazeEditProjectViewImportWizardStep.java:54)
	at com.google.idea.blaze.base.wizard2.BlazeEditProjectViewImportWizardStep.updateStep(BlazeEditProjectViewImportWizardStep.java:46)
	at com.google.idea.blaze.base.wizard2.BlazeNewProjectWizard.updateStep(BlazeNewProjectWizard.java:88)
	at com.google.idea.blaze.base.wizard2.BlazeNewProjectWizard.doFinishAction(BlazeNewProjectWizard.java:138)
	at com.google.idea.blaze.base.wizard2.BlazeNewProjectWizard.lambda$doOKAction$0(BlazeNewProjectWizard.java:98)
	at com.intellij.openapi.project.DumbService.allowStartingDumbModeInside(DumbService.java:367)
	at com.google.idea.blaze.base.wizard2.BlazeNewProjectWizard.doOKAction(BlazeNewProjectWizard.java:97)
	at com.intellij.ide.wizard.AbstractWizard.access$200(AbstractWizard.java:37)
	at com.intellij.ide.wizard.AbstractWizard$5.actionPerformed(AbstractWizard.java:182)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
	at com.chrisrm.idea.ui.MTButtonUI$ButtonHighlighter.mouseReleased(MTButtonUI.java:387)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6416)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	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.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	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:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:846)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:778)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
	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.pumpEventsForFilter(EventDispatchThread.java:117)
	at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.desktop/java.awt.Dialog.show(Dialog.java:1063)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:708)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:433)
	at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1698)
	at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1657)
	at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1671)
	at com.google.idea.blaze.base.wizard2.BlazeImportProjectAction.actionPerformed(BlazeImportProjectAction.java:39)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:298)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:315)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:474)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:459)
	at com.intellij.ui.components.labels.ActionLink$1.linkSelected(ActionLink.java:45)
	at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:142)
	at com.intellij.ui.components.labels.ActionLink.doClick(ActionLink.java:54)
	at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:330)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6416)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	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.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	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:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:846)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:778)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
	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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment