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

Flutter初学者求助:flutter doctor检测异常问题(Android Studio未安装提示、IntelliJ Java执行失败、Visual Studio缺失)的解决方法

Fixing the Three Flutter Doctor Issues You're Seeing

First, let's recap your current setup to make sure we're on the same page:

Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (2 months ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4

Let's tackle each problem step by step:

1. Flutter Doctor says Android Studio isn't installed, but you have it

This usually happens because Flutter can't auto-detect where Android Studio is installed. Here's how to fix it:

  • Open Android Studio, go to File > Settings > Languages & Frameworks > Flutter (for Windows/Linux) or Android Studio > Settings > Languages & Frameworks > Flutter (for Mac)
  • Double-check that your Flutter SDK path is correct, and confirm the Android SDK path points to the right directory (usually something like C:\Users\YourName\AppData\Local\Android\Sdk)
  • If that doesn't work, set an environment variable manually:
    1. Find your Android Studio root folder (e.g., C:\Program Files\Android\Android Studio)
    2. Add a new system environment variable called ANDROID_STUDIO with that folder path as the value
    3. Restart PowerShell and run flutter doctor again to check

2. Failed to execute IntelliJ IDEA's Java binary

The error points to C:\Users\lenovo\IntelliJ IDEA Community Edition 2021.1\bin\java—chances are the actual Java path in your IntelliJ install is different (newer IntelliJ versions use a bundled JBR in the jbr folder). Try these steps:

  • First, verify the correct Java path in your IntelliJ folder: navigate to C:\Users\lenovo\IntelliJ IDEA Community Edition 2021.1\jbr\bin and check if java.exe exists there
  • Tell Flutter where to find it by running these commands in PowerShell:
    # Point Flutter to your IntelliJ installation
    flutter config --android-studio-dir "C:\Users\lenovo\IntelliJ IDEA Community Edition 2021.1"
    # Or directly specify the JDK folder
    flutter config --jdk-dir "C:\Users\lenovo\IntelliJ IDEA Community Edition 2021.1\jbr"
    
  • Restart PowerShell and run flutter doctor to see if the error clears up

3. Missing Visual Studio for Windows development

If you plan to build Flutter apps for Windows, you'll need to install Visual Studio properly:

  • Grab the full Visual Studio installer (not the lightweight version)
  • When installing, make sure to select the Desktop development with C++ workload—and don't skip any of its default components (they're required for Flutter Windows builds)
  • Once installation finishes, restart your computer and run flutter doctor again; this issue should be resolved
  • Note: If you don't need to develop for Windows right now, you can safely ignore this error—it won't affect your Android or Web development work

内容的提问来源于stack exchange,提问作者Aysha Thasneem AM

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.30 10:47:53