0

I am new to Intellij IDEA. I recently upgraded Intellij from 2021.1 to 2021.2. After indexing, all the fields and methods are not recognized. When we hover the mouse over the field I get a message stating "cannot resolve symbol". I found this which says to delete the main.iml. However, I'm not able to find main.iml but <project_name>.iml is present under .idea folder. By deleting the <project_name>.iml the whole project structure is destroyed. Where do I find main.iml file.

PS: Mine is neither a Maven nor a Gradle project. I'm using ANT.

1 Answers1

0

I found this which says to delete the main.iml. However, I'm not able to find main.iml but <project_name>.iml is present under .idea folder.

main.iml is a project/module name. In your case it will be <project_name>.iml.

"cannot resolve symbol"

You can try to do:

  • File | Invalidate caches... | Invalidate and Restart
  • Close the project File | Close Project
  • Close the IDE
  • Delete all .iml files and the.idea directory
  • Re-import the project into IntelliJ from Existing sources
Egor Klepikov
  • 3,386
  • 5
  • 19
  • 34
  • Mine is not a Gradle project as mentioned, I'm using ant as a build tool. Choosing Gradle project is not an option for me. I get an error saying 'settings.gradle(.kts)' is missing when I choose Gradle. Neither is the Eclipse project working for me. – GAGAN GOWDA Aug 10 '21 at 15:36