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

Android Studio打开已有Flutter应用报错咨询:DART SDK未配置、无设备

Fixing Two Common Flutter Issues in Android Studio: "DART SDK IS NOT CONFIGURED" and "NO DEVICE"

Hey there, let's break down how to fix these two frustrating errors when opening an existing Flutter app in Android Studio. I've dealt with these plenty of times, so here's what works reliably:


1. Resolving "DART SDK IS NOT CONFIGURED"

This error usually means Android Studio can't locate your Dart SDK (which comes bundled with the Flutter SDK). Try these steps in order:

  • Verify Flutter & Dart Plugins Are Installed
    Head to File > Settings > Plugins (Windows/Linux) or Android Studio > Settings > Plugins (Mac). Search for "Flutter" and "Dart" — make sure both are installed and enabled. If you just installed them, restart Android Studio to apply changes.

  • Manually Specify the Dart SDK Path
    If plugins are set up but the error persists:

    1. Go to File > Project Structure > Modules
    2. Select your Flutter module from the list
    3. Look for the "Dart SDK path" field, then navigate to your Flutter installation directory and select the bin/cache/dart-sdk folder (this is where the bundled Dart SDK lives)
    4. Click "Apply" and "OK"
  • Use flutter doctor to Diagnose & Fix
    Open your terminal (inside Android Studio or your system terminal) and run:

    flutter doctor
    

    This command scans your setup and lists any missing components or configuration issues. Follow the prompts — for example, you might need to run flutter doctor --android-licenses to accept required Android licenses.


2. Fixing "NO DEVICE"

This means Android Studio can't detect any connected physical device or running emulator. Try these fixes:

  • Set Up a Physical Android Device

    1. Connect your Android phone to your computer via USB
    2. Enable Developer Options on your device: Go to Settings > About Phone and tap "Build Number" 7 times until you see a message saying "You are now a developer!"
    3. Go back to Settings, open "Developer Options", and toggle on "USB Debugging"
    4. Check Android Studio's device dropdown (top right corner) — your device should appear now. If not, try unplugging and re-plugging the USB cable, or restarting your device.
  • Create & Launch an Android Emulator

    1. Click the "Device Manager" icon (looks like a phone) in the Android Studio toolbar
    2. Click "Create Virtual Device"
    3. Choose a device model (like Pixel 5) and click "Next"
    4. Select a system image (preferably a recent one like API 33 or higher) — if it's not downloaded, click "Download" and wait for it to finish
    5. Configure any additional settings (like storage) then click "Finish"
    6. Launch the emulator from Device Manager — once it's running, it should show up in Android Studio's device dropdown.
  • Check Environment Variables
    Make sure your system has these environment variables set:

    • ANDROID_HOME: Points to your Android SDK installation directory (usually ~/Android/Sdk on Mac, C:\Users\<YourName>\AppData\Local\Android\Sdk on Windows)
    • PATH: Includes the Flutter bin directory (like ~/flutter/bin on Mac, C:\flutter\bin on Windows)
      Running flutter doctor again will confirm if these are set correctly.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.14 08:25:31