Intellij Cannot resolve symbol on import
There can be multiple reasons for this. In my case it was wrong source root issue. Invalidate caches didn't work along with other solutions.
Check your module source roots.
Project Structure (Ctrl+Alt+Shift+S).
Modules
Select your problem module.
Change tab on top of window "Sources".
Remove unwanted source roots. Keep one and add src and test source roots in this root.
Cannot resolve symbol in Intellij IDEA
You need to add your external libraries/classes under dependencies in order for IDEA to see them when doing code analysis/autocomplete.
IntelliJ inspection gives Cannot resolve symbol but still compiles code
First of all you should try File | Invalidate Caches
and if it doesn't help, delete IDEA system directory. Then re-import the Maven project and see if it helps.
In some weird cases compiled classes may report wrong info and confuse IDEA. Verify that the classes from this jar report correct names using javap.
IntelliJ cannot resolve any symbols or methods
The answer was the look through the pom.xml file line by line, and see what the dependencies were that I didn't have. I thought it was a configuration issue, but it wasn't.
I didn't notice that I didn't have the lombok plugin, which was a dependency for my project.
The problem listed in EDIT2 wasn't actually an issue since all of the classes were available.
IntelliJ inspection gives Cannot resolve symbol but still compiles code
First of all you should try File | Invalidate Caches
and if it doesn't help, delete IDEA system directory. Then re-import the Maven project and see if it helps.
In some weird cases compiled classes may report wrong info and confuse IDEA. Verify that the classes from this jar report correct names using javap.
IntelliJ IDEA: cannot resolve symbol for String, System and other Java classes
Check the JDK configuration Classpath tab in Project Structure | SDKs:
Also check that project and modules use the same JDK.
If it's empty, remove the JDK and add it again. It's not recommended to use JetBrains Runtime as your JDK, download and configure some different standalone JDK instead, 2020.1 version can download JDK for you.
Important notice
The bundled JRE is used for running the IDE itself,
and it's not sufficient for developing Java applications. Before you
start developing in Java, download and install a standalone JDK build.
Related Topics
Differences Between Java 8 Date Time API (Java.Time) and Joda-Time
Rollback Transaction After @Test
Is Polymorphism Possible Without Inheritance
Registering Multiple Keystores in Jvm
Moving Items Around in an Arraylist
Exception in Initializer Error in Java When Using Netbeans
Why Do We Have to Override the Equals() Method in Java
How Does Java Decide When to Import
How to Set Hard Limit on a Jcomponent When Setmaximumsize() and Setprefferedsize() Don't Work
Java.Util.Date to Xmlgregoriancalendar
Default Fetch Type for One-To-One, Many-To-One and One-To-Many in Hibernate
Understanding Jsf as a MVC Framework
Change a Method at Runtime via a Hot Swap Mechanism
How to Add a New Sourceset to Gradle
Why Isn't a Qualified Static Final Variable Allowed in a Static Initialization Block