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

Android Studio无设备列表,运行未询问设备选择且配置菜单报错

Hey, I’ve dealt with almost identical issues in Android Studio before—let’s break this down into fixable steps:

1. Fixing the "Auto-runs on Emulator, Ignores Physical Device" Issue

First, let’s make sure your physical device is being recognized properly, then adjust the run settings to let you choose where to deploy:

  • Enable full USB debugging on your device

    • Unlock Developer Options by tapping your device’s Build Number 7 times (found in Settings > About Phone).
    • Go to Developer Options and check:
      • USB Debugging
      • USB Installation (allows installing apps via USB)
      • Some devices also require USB Debugging (Security Settings) to grant installation permissions.
  • Verify device recognition in Android Studio

    • Check the device dropdown menu in the top-right corner of AS (next to the Run button). If your physical device isn’t listed:
      • Unplug and re-plug the USB cable, or try a different USB port (avoid USB 3.0 ports if possible—they can cause compatibility glitches).
      • Restart the ADB server via Terminal in AS:
        adb kill-server
        adb start-server
        
      • Sync your project with Gradle: Go to File > Sync Project with Gradle Files.
  • Force Android Studio to ask for a deployment target

    • Click the run button’s dropdown menu and select Edit Configurations...
    • In the window that pops up, select your app’s configuration, then go to the General tab.
    • Under Deployment Target Options, set the target selection to Open Select Deployment Target Dialog (instead of auto-selecting the emulator).
    • Hit Apply > OK, then try running your app again—you should see a prompt to choose between your emulator and physical device.
2. Resolving the Configuration Menu Error

If accessing the configuration menu throws errors, this is usually tied to corrupted caches or misconfigured Gradle files:

  • Clear Android Studio’s cache

    • The quickest way is to use AS’s built-in tool: Go to File > Invalidate Caches..., check Invalidate and Restart, and let AS reboot. This clears corrupted cache files that often cause menu glitches.
    • If that doesn’t work, manually delete the cache directory:
      • Windows: C:\Users\<Your Username>\.AndroidStudio<Version>\system\caches
      • Mac: ~/Library/Caches/Google/AndroidStudio<Version>
  • Fix Gradle configuration issues

    • Open your project’s root-level build.gradle file and ensure the Android Gradle Plugin version matches your AS version (e.g., AS Hedgehog requires plugin version 8.2+, Gradle version 8.3+).
    • Delete the .gradle folder (both in your project root and your user directory), then sync the project again via File > Sync Project with Gradle Files. This rebuilds the Gradle configuration from scratch.
  • Recreate corrupted run configurations

    • If the existing run config is broken, delete it: In Edit Configurations..., select your app config, click the minus icon to remove it.
    • Click the plus icon, choose Android App, and set up the configuration with default settings. Save it, then try accessing the menu again.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 08:18:46