IntelliJ IDEA suddenly lost all class relations. Cannot resolve symbol
Asked Answered
A

2

6

I committed and pushed my changes business as usual and packed my laptop. As I docked it at the office and opened IntelliJ IDEA again. All the project classes were shouting red. As in No classes were found, all imports were red, as in not found. The project builds and deploys as usual.

Every class reference just gives the error "cannot resolve symbol..." and is red. Even the most basic sch as @Inject annotation (javax).

I tried the usual tricks such as maven reimport to no avail. What should I do to fix this? Clone the project again?

Using mercurial repository with external GUI HgTortoise, IDEA version is 15.0.4

Airdrop answered 28/11, 2016 at 13:5 Comment(2)
You could start by giving IntelliJ a restart.Forewent
@Forewent I restarted IntelliJ twice and restarted Windows also. Usually this fixes this type of problems but not this time.Airdrop
B
9

Try File -> Invalidate Caches / Restart

Birgit answered 28/11, 2016 at 13:33 Comment(1)
That's it! Thanks, Dmitry! Never even heard of this. You saved the day.Airdrop
G
1

Delete .idea folder and .iml file, then reopen the project, as in my case.

Gusti answered 15/3, 2019 at 10:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.