You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Android Studio中Flutter设备列表不显示问题求助

Fix: "Unable to list devices: Unable to discover Android devices" in Flutter with Android Studio

Hey, I’ve dealt with this exact frustration before—let’s walk through practical steps to get your emulator/physical device showing up properly in Android Studio for Flutter development.

Step 1: Run flutter doctor first (as the error suggests)

Open Android Studio’s Terminal tab, or your system’s command prompt, and run:

flutter doctor

This command will flag exactly what’s broken—whether it’s missing SDK components, unconfigured paths, or adb issues. Pay close attention to any lines marked with a red X under the Android section.

Step 2: Verify ADB is working correctly

ADB (Android Debug Bridge) is the backbone of device detection. Run this command to check if it can see your devices:

adb devices
  • If you get no output or an error like "adb not found", you need to add the Android SDK’s platform-tools folder to your system’s PATH. You can find this folder in your Android SDK directory (usually C:\Users\<YourName>\AppData\Local\Android\Sdk\platform-tools on Windows).
  • If adb devices shows your device but Android Studio doesn’t, move to the next steps.

Step 3: Check device settings (physical or emulator)

For physical Android devices:

  • Enable Developer Options: Go to Settings > About Phone and tap the Build Number 7 times until you see the "You’re now a developer!" message.
  • Turn on USB Debugging in the Developer Options menu.
  • When you connect your phone to your computer, a pop-up will appear on the device—make sure to tap Allow to grant debugging access.

For emulators:

  • Open Android Studio’s AVD Manager (the phone icon in the toolbar).
  • Check if your emulator is properly configured: Make sure it has a valid system image installed, and try launching it directly from AVD Manager first. If it launches successfully, go back to Android Studio and check the device list again.

Step 4: Restart the ADB service

Sometimes ADB gets stuck. Kill and restart it with these commands:

adb kill-server
adb start-server

After running these, check the device list in Android Studio again.

Step 5: Confirm Android Studio’s SDK configuration

  • Go to File > Settings > Appearance & Behavior > System Settings > Android SDK (on Windows/Linux) or Android Studio > Settings > Android SDK (on Mac).
  • Under the SDK Platforms tab, ensure you have at least one Android version installed (match the version your emulator/device is running).
  • Under the SDK Tools tab, make sure Android SDK Platform-Tools and Android SDK Build-Tools are installed and up to date.

Step 6: Ensure Flutter is pointing to the correct Android SDK

Run these commands to set the SDK path for Flutter (replace the path with your actual SDK location):

flutter config --android-sdk C:\Users\<YourName>\AppData\Local\Android\Sdk

If needed, you can also set the Android Studio path:

flutter config --android-studio-dir C:\Program Files\Android\Android Studio

Step 7: Restart everything

Sometimes the simplest fix works—restart Android Studio, your emulator/physical device, and even your computer if needed. This clears any cached connection issues.


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

火山引擎 最新活动