Java project with Gradle in IntelliJ IDEA: cannot resolve symbol 'google' but project compiles

I think user Sap is correct, at least in my case. You should not have to manually add the dependency.

Did you change the dependencies in the gradle file without syncing intellij? Try this button:

screenshot of sync button

For more information, see: https://www.jetbrains.com/idea/help/synchronizing-changes-in-gradle-project-and-intellij-idea-project.html


Check this.

You can simply open Gradle tool window at [ View ] - [ Tool Windows ] - [ Gradle ].

In the window, you can refresh by clicking refresh button.

All dependencies manually added directly into build.gradle file will be resolved.


One of the solutions that worked for me after trying everything listed on the internet to solve this issue was to install the lombok plugin.

Got to File --> Settings --> Plugins and look for Lombok.

Make sure the "Enable annotation processing" is ticked