I have a toy Java project set up with Gradle in IntelliJ IDEA 13.1.2. It compiles and runs fine, but the IDE highlights 'google' in
import com.google.common.base.Strings;
as red and warns "Cannot resolve symbol 'google'". Any idea how to fix it?
I have tried 1) deleting .idea/
and re-creating the project in IntelliJ IDEA, and 2) re-importing project from the manually created Gradle configuration file build.gradle
, but to no avail.
Navigate to the build.In the Gradle tool window, right-click a linked project. From the context menu, select Open Gradle config F4 . IntelliJ IDEA navigates to the appropriate Gradle configuration file and the related build. gradle file opens in the editor.
Open your project in IntelliJ IDEA. In the Project tool window, right-click the name of your project and select New | File. In the dialog that opens enter build. gradle and click OK.
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:
For more information, see: https://www.jetbrains.com/idea/help/synchronizing-changes-in-gradle-project-and-intellij-idea-project.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With