[IDEA "Cannot resolve symbol XXXX" solution]

Method 1: First check whether the pom file depends on whether an error is reported, and the error needs to be re-imported

Method 2: Restart IDEA and clear the cache

IDEA cannot recognize other classes in the same package and displays them in red, but there is no problem with compile. After putting the mouse on it, "Cannot resolve symbol XXX" is displayed, restarting IDEA, re-syncing gradle, and Clean build are useless.

Mostly because of an error in IDEA before, some settings went wrong. The solution is as follows:

Click "File" -> "Invalidate Caches / Restart" in the menu, and then click "Invalidate and Restart" in the dialog box to clear the cache and restart. The syntax will be correctly highlighted.

Method 3: Delete .idea, then restart idea

Guess you like

Origin blog.csdn.net/qq_39236283/article/details/126037272