Flutter Device Selection 卡在 Loading...在 Android Studio 中

Flutter Device Selection stuck at Loading... in Android Studio

提问人:infinitesimal 提问时间:11/17/2023 最后编辑:infinitesimal 更新时间:11/17/2023 访问量:39

问:

我在 flutter 设备选择上有问题,它卡在 Loading ...我可以展开此选择,但每次都是可能的选项,例如当我单击它时,它会出现:Open Andorid Emulator: {...}

INFO | Android emulator version 33.1.21.0 (build_id 11009868) (CL:N/A) INFO | Found systemPath C:\Users\xxx\AppData\Local\Android\Sdk\system-images\android-34\google_apis\x86_64\ [11292:10984:20231117,085610.488:ERROR filesystem_win.cc:130] GetFileAttributes C:\Users\xxx\AppData\Local\Temp\\AndroidEmulator\emu-crash-33.1.21.db\attachments\29a4c8fc-f8a5-450f-923a-b2b887559972: Nie można odnaleźć określonego pliku. (2) [11292:10984:20231117,085610.488:ERROR filesystem_win.cc:130] GetFileAttributes C:\Users\xxx\AppData\Local\Temp\\AndroidEmulator\emu-crash-33.1.21.db\attachments\abaa2978-3250-4094-844e-c6ae4f55757b: Nie można odnaleźć określonego pliku. (2) INFO | Ignore IPv6 address: 88d5:8846:7d02:0:309f:8846:7d02:0 (2x) ERROR | Running multiple emulators with the same AVD ERROR | is an experimental feature. ERROR | Please use -read-only flag to enable this feature. INFO | Storing crashdata in: , detection is enabled for process: 8572 INFO | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag. INFO |

我尝试了各种可能的方法来解决这个问题,例如:

  • 重置电脑

  • 将 Location SDK 文件夹从 C:\Flutter 更改为 D:\Flutter

  • 更改 Android Studio 版本

  • 更改 SDK 版本旧、新

  • 更改 API 版本

  • 立即更改虚拟设备、擦除数据、冷启动、

  • 与物理设备连接,Andorid studio 可以识别它,但没有选择它的选项Flutter Device Selection

  • 与队友相比,他使用相同版本的 SDK (3.7.9) 和 android studio 轻松解决问题(我在想也许公司防火墙或 antivir 阻止了它)

  • 当我创建新的 flutter 项目时,它卡在 Loading...也

  • 当我运行 main() 时,它显示:“未找到连接的设备...”

  • 重置 adb (adb kill-server, adb start-server)

  • 删除 SDK platform-tools 文件夹并下载新的

  • 文件 -> 使缓存失效/重新启动

  • 我尝试使用 Flutter 插件在 Visual Studio Code 中运行该项目,但我也被卡住了,什么也没发生

  • 当我运行“taskkill /F /IM dart.exe”然后“flutter run”时,几秒钟后出现 andorid 警报:“Flutter 设备守护程序崩溃,无法启动 flutter 设备守护程序。请检查您的配置并重新启动 IDE。您可能需要增加全局可用的文件句柄的最大数量。

  • 颤振医生 -v:

[!] Flutter (Channel @upstream, 3.7.9, on Microsoft Windows [Version 10.0.19045.3570], locale pl-PL)
    • Flutter version 3.7.9 on channel @upstream at D:\flutter
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Framework revision 62bd79521d (8 months ago), 2023-03-30 10:59:36 -0700
    • Engine revision ec975089ac
    • Dart version 2.19.6
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\xxx\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Users\xxx\AppData\Local\Programs\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.7.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.7.34221.43
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Users\xxx\AppData\Local\Programs\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] IntelliJ IDEA Community Edition (version 2023.1)
    • IntelliJ at C:\Users\xxx\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\231.9225.16
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.84.2)
    • VS Code at C:\Users\xxx\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.76.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.3570]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 118.0.5993.118
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 119.0.2151.58

[√] HTTP Host Availability
    • All required HTTP hosts are available

编辑:

flutter devices
4 connected devices:

sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.3570]
Chrome (web)                 • chrome        • web-javascript • Google Chrome 118.0.5993.118
Edge (web)                   • edge          • web-javascript • Microsoft Edge 119.0.2151.58
安卓 Flutter Android-Studio

评论

1赞 pskink 11/17/2023
命令行中 run 的输出是什么?flutter devices
0赞 infinitesimal 11/17/2023
我已经编辑了帖子
1赞 pskink 11/17/2023
现在你跑了会看到什么?它是否比从 Android Studio 运行时说得更多?flutter run -d emulator-5554
0赞 infinitesimal 11/17/2023
当我启动项目时,项目运行并正常工作。Flutter 设备选择仍处于 Loading...flutter run -d emulator-5554
0赞 infinitesimal 11/20/2023
@pskink是否可以在调试模式下以这种方式运行模拟器?我放置了断点,但应用程序并没有停止它。
1赞 pskink 11/20/2023
我不知道,虽然我总是从命令行使用,但我使用了 VSCode 调试会话可能三次左右......(好,老总能救我一命)flutter runprint(...)

答: 暂无答案