IntelliJ downloads Gradle dependencies but cannot find them during compile

◇◆丶佛笑我妖孽 提交于 2020-07-24 03:13:49

问题


IntelliJ downloaded the dependencies listed in my build.gradle file and they show up in the External Library, but IntelliJ fails to find them during compile. It just throws a bunch of "package x does not exist" and "cannot resolve symbol". Under the Project Structure -> Modules -> Dependencies they all show up and are listed as compile.

If I try to build it with Gradle it's successful, so it's just IntelliJ. Any ideas?

If it's important, I'm using this on a Mac.


回答1:


Found the answer. IntelliJ was treating Main and Test as modules with no dependency related to the project itself and all of the library dependencies were stored at the project level.

I killed off Main and Test as modules and it sorted itself out.



来源:https://stackoverflow.com/questions/27803355/intellij-downloads-gradle-dependencies-but-cannot-find-them-during-compile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!