I upgraded my IntelliJ IDEA installation from 2018.3 to 2019.1 and am now seeing errors in my build.gradle
that were not there before. I suspect changed preferences but can not find any.
I am seeing two kinds of errors:
This worked fine in 2018.3. The gradle build works, i.e. running ./gradlew …:build
from the command line works and so does running gradle tasks from the IDE.
Update
I noticed that in "Project structure" the root module (this is a multi-module build) existed twice: once with the name in settings.gradle
and once with the name of the directory the code is in. When changing the name in settings.gradle
to the name of the directory, the duplicate entry in "Project structure" disappeared and the errors in build.gradle
disappeared.
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.
Try re-importing the gradle project:
IntelliJ IDEA ➔ Help ➔ Find Action ➔ search for "import" or "reimport" ➔ Click on: "Reimport All Gradle Projects"
Edit: This has changed to: Gradle (from the right toolbar) ➔ "Reload All Gradle Projects" (small refresh button)
Fixed with File -> Invalidate caches / Restart
Help -> Find action... -> Reload All Gradle Projects
didn't work in Idea 2020.2 with me.
The same occurred to me in Idea 2019.2 created the spring project from idea and by deleting the .iml file and .idea folder it was fixed
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