I am working on a Gradle project in IntelliJ and some packages are not recognized by IntelliJ. When I go to Project Structure -> Modules -> <my module>
-> Dependencies, the jar file that contains these packages is there. (I've examined the jar file with jar tfv <file>
to make sure that the classes in question are in the file.)
The classes in question are in red and when hovering over them, I get errors like "Cannot resolve symbol 'somepackagename'" or "Cannot resolve symbol 'SomeClassName'".
However, the gradle project compiles just fine from the command line.
I've tried all the existing suggestions I could find, but so far none have helped. Primarily, I've already tried:
- Deleting the .idea folder and re-importing
- Reimporting the project from the root build.gradle file
- Clicking on the "Refresh all gradle projects" button
- Upgrading IntelliJ
- Clicking on "Invalidate Caches and Restart"
What can I do to get IntelliJ to recognize the packages in these jar files?