解决办法: 菜单 File》invalidate Caches 清除缓存,重启idea。我的报红问题解决了。 备注:我的idea版本是2024.2最新版本 把勾都打上,直接点击Invalidate and Restart