Search code examples
intellij-ideakotlincode-inspection

How to revert a module dependency exclusion in Intellij (after code inspection false positive)


I ran the intelliJ code inspection and it gave me a "Unnecessary module dependency". I "fixed it" but indeed it was a false positive.

So I clicked to "fix it" and it removed the dependency of my test-folder from the source-folder, however now all my test classes give me the "Unresolved reference" error. How do I revert it? Or maybe, how do I add the dependency again?

That's an image to understand better the issue enter image description here


Solution

  • If this is a Gradle project, the dependency should be re-added if you simply reimport it from Gradle (press the "Refresh all Gradle projects" toolbar button in the Gradle toolwindow).