raniejade / spek-idea-plugin

MIT License
48 stars 15 forks source link

Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null #30

Closed proteus-russ closed 7 years ago

proteus-russ commented 7 years ago

Getting this error in IDEA 2016.3.3 when running gradle tasks from within the IDE. Let me know what other information you need. Thanks.

Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null
    at com.intellij.openapi.roots.ModuleRootManager.getInstance(ModuleRootManager.java)
    at org.jetbrains.spek.idea.SpekRunConfigurationProducer.setupConfigurationFromContext(SpekRunConfigurationProducer.kt:40)
    at org.jetbrains.spek.idea.SpekRunConfigurationProducer.setupConfigurationFromContext(SpekRunConfigurationProducer.kt:22)
    at com.intellij.execution.actions.RunConfigurationProducer.createConfigurationFromContext(RunConfigurationProducer.java:90)
    at com.intellij.execution.junit.JavaRunConfigurationProducerBase.createConfigurationFromContext(JavaRunConfigurationProducerBase.java:64)
    at com.intellij.execution.actions.RunConfigurationProducer.findOrCreateConfigurationFromContext(RunConfigurationProducer.java:178)
    at com.intellij.execution.actions.PreferredProducerFind.getConfigurationsFromContext(PreferredProducerFind.java:107)
    at com.intellij.execution.actions.PreferredProducerFind.findConfigurationFromContext(PreferredProducerFind.java:132)
    at com.intellij.execution.actions.PreferredProducerFind.createConfiguration(PreferredProducerFind.java:43)
    at com.intellij.execution.actions.ConfigurationContext.createConfiguration(ConfigurationContext.java:148)
    at com.intellij.execution.actions.ConfigurationContext.getConfiguration(ConfigurationContext.java:139)
    at com.intellij.openapi.externalSystem.action.task.RunExternalSystemTaskAction.perform(RunExternalSystemTaskAction.java:55)
    at com.intellij.openapi.externalSystem.action.task.RunExternalSystemTaskAction.perform(RunExternalSystemTaskAction.java:36)
    at com.intellij.openapi.externalSystem.action.ExternalSystemNodeAction.actionPerformed(ExternalSystemNodeAction.java:65)
    at com.intellij.openapi.externalSystem.action.ExternalSystemActionUtil.executeAction(ExternalSystemActionUtil.java:56)
    at com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl.handleDoubleClickOrEnter(ExternalProjectsViewImpl.java:265)
    at com.intellij.openapi.externalSystem.view.ExternalSystemNode.handleDoubleClickOrEnter(ExternalSystemNode.java:400)
    at com.intellij.ui.treeStructure.SimpleTree.lambda$handleDoubleClickOrEnter$1(SimpleTree.java:399)
    at com.intellij.openapi.application.TransactionGuardImpl$6.run(TransactionGuardImpl.java:318)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:417)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:401)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    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.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:843)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:679)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
    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)
raniejade commented 7 years ago

Tried replicating it, but failed. Can you give detailed steps to replicate this?

proteus-russ commented 7 years ago

It happens in any of our gradle projects when you run a task from within the IDE. I updated to the newest Intellij and Spek 0.3.3 plugin and it still occurs. See screenshot: http://imgur.com/a/bxW4x

raniejade commented 7 years ago

@rtennantventuretech Thanks, will look into it.

fknop commented 7 years ago

I'm having the same issue with 0.3.4, has it been released yet?

raniejade commented 7 years ago

@fknop 0.3.4 has been out months ago. Can you provide the error you're experiencing.

encodeering commented 7 years ago

Hello,

@raniejade I can add the stacktrace for 0.3.4

IntelliJ IDEA 2017.1.3
Build #IU-171.4424.56, built on May 12, 2017
JRE: 1.8.0_112-release-736-b21 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null
    at com.intellij.openapi.roots.ModuleRootManager.getInstance(ModuleRootManager.java)
    at org.jetbrains.spek.idea.SpekRunConfigurationProducer.isConfigurationFromContext(SpekRunConfigurationProducer.kt:113)
    at org.jetbrains.spek.idea.SpekRunConfigurationProducer.isConfigurationFromContext(SpekRunConfigurationProducer.kt:22)
    at com.intellij.execution.actions.RunConfigurationProducer.findExistingConfiguration(RunConfigurationProducer.java:210)
    at com.intellij.execution.actions.ConfigurationContext.findExisting(ConfigurationContext.java:229)
    at com.intellij.openapi.externalSystem.action.task.RunExternalSystemTaskAction.perform(RunExternalSystemTaskAction.java:52)
    at com.intellij.openapi.externalSystem.action.task.RunExternalSystemTaskAction.perform(RunExternalSystemTaskAction.java:36)
    at com.intellij.openapi.externalSystem.action.ExternalSystemNodeAction.actionPerformed(ExternalSystemNodeAction.java:65)
    at com.intellij.openapi.externalSystem.action.ExternalSystemActionUtil.executeAction(ExternalSystemActionUtil.java:56)
    at com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl.handleDoubleClickOrEnter(ExternalProjectsViewImpl.java:263)
    at com.intellij.openapi.externalSystem.view.ExternalSystemNode.handleDoubleClickOrEnter(ExternalSystemNode.java:400)
    at com.intellij.ui.treeStructure.SimpleTree.lambda$handleDoubleClickOrEnter$1(SimpleTree.java:399)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:303)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:410)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
    at com.intellij.ide.IdeEventQueue.k(IdeEventQueue.java:827)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:655)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
    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)
avdvyver commented 6 years ago

Just as general note for anybody running into this - I did two things to solve the problem

jhowardsandy commented 6 years ago

I was able to resolve this by opening the IntelliJ settings -> Build, Execution, and Deployment -> Build Tools -> Gradle: From here I needed to update the selected gradle and SDK values. The ones from my project were incorrect, likely checked into version control that way.

2020gaurav commented 5 years ago

I am facing the same issue with Android Studio, I follow @jhowardsandy steps, once i reach to "Gradle" in preferences popup (i am on Mac), there was no way to update gradle. There is an option say "Use default gradle wrapper" which is by default selected.

Although i am using: distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

Its inside my gradle-wrapper.properties file, which is the latest version.

smurfless1 commented 2 years ago

I hit this after an upgrade once because the run/debug configuration had somehow set the python instance to "None". Picking one made this disappear.

ZeinSulayman commented 1 year ago

I am on a Mac encountering the same error message but on Pycharm instead. When I go to preferences -> Build, Execution, Development there is no option for gradle. Confused on how to fix it.

chitrasymbl commented 1 year ago

@ZeinSulayman I am facing the same issue with Pycharm. Did you yet find any solution to this error ?

ZeinSulayman commented 1 year ago

@chitrasymbl It was a while back but I think I went through a series of deleting and reinstalling pycharm until it worked. Make sure you download the Apple Silicon M1 version of pycharm instead of the intel one.

chishichengyang commented 1 year ago

1677589034350 this is answer!!!!

wanxinran commented 1 year ago

^This worked for me!

It says: It happens when issues occur in .idea directory. Just remove the .idea directory under your python project, close the current project. When you reopen pycharm, the project directory will re-generate another .idea directory, and problem solved.

i-am-shipwrecked commented 9 months ago

^This worked for me!

It says: It happens when issues occur in .idea directory. Just remove the .idea directory under your python project, close the current project. When you reopen pycharm, the project directory will re-generate another .idea directory, and problem solved.

ty, worked