Solution 1:
After putting the mouse on it, it will display "Cannot resolve symbol XXX" Click to complete the reference
Solution 2: (quote in full)
Restart Android Studio, re-sync gradle, Clean build
Solution 3: (quote in full)
Click "File" -> "Invalidate Caches/Restart" in the menu,
Then click "Invalidate Restart" in the dialog box to clear the cache and restart.