You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio中Flutter项目红色高亮文件夹问题求助

Hey there! I get how frustrating those random red highlights can be, especially when everything else in your Flutter setup is working perfectly (great job getting flutter doctor to show no issues, by the way!). Let's fix this one step at a time, since you mentioned you don't need version control right now.

1. Turn Off VCS Integration (to fix the @style/NormalTheme red marker)

Since you're not using a version control system right now, the VCS indexing might be causing false error flags like the @style/NormalTheme issue. Here's how to disable it:

  • Open File > Settings (or press Ctrl+Alt+S on Windows/Linux, Cmd+, on Mac)
  • Navigate to Version Control in the left sidebar
  • In the right pane, find your project in the list, click on it, and change the VCS dropdown menu to <None>
  • Click Apply then OK to save the changes

This should immediately get rid of any VCS-related red markers.

2. Mark Auto-Generated Folders as "Excluded" (fix dart_tool & idea red highlights)

Folders like dart_tool and those inside idea are auto-generated by Flutter/Android Studio, and they shouldn't be indexed by the IDE. Marking them as excluded will stop the red highlighting:

  • In the left Project view, right-click on the dart_tool folder
  • Hover over Mark Directory as and select Excluded
  • Repeat this for all folders inside the idea directory that are showing red highlights

Once marked as excluded, the IDE will ignore these folders, and the red color should disappear right away.

3. Optional: Clear IDE Cache (for stubborn cases)

If the above steps don't work immediately, a quick cache reset can fix lingering indexing issues:

  • Go to File > Invalidate Caches...
  • In the popup, select Invalidate and Restart
  • Let Android Studio restart and reindex your project—this usually clears up any weird leftover highlight issues

That should cover all the red highlight problems you're facing! Everything should look clean and normal once you're done.

内容的提问来源于stack exchange,提问作者Prashant Rawat

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 06:08:19