debugging Flutter调试:等待调试连接时出错:错误状态:无元素

gdx19jrr  于 2023-03-23  发布在  Flutter
关注(0)|答案(4)|浏览(219)

我在调试flutter中新创建的项目时出错。这是出错前的日志。

  1. [ +1 ms] executing: C:\Users\pfernandes\AppData\Local\Android\sdk\platform-tools\adb.exe -s 0123456789ABCDEF shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true --ez start-paused true com.mycompany.my_app_pos_payment_app/com.mycompany.my_app_pos_payment_app.MainActivity
  2. [ +696 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.mycompany.my_app_pos_payment_app/.MainActivity (has extras) }
  3. [ ] Waiting for observatory port to be available...
  4. [ +4 ms] Error waiting for a debug connection: Bad state: No element
  5. [ ] Error launching application on N910.

我可以毫无问题地调试一个纯Android项目。
这是我的医生:

  1. [√] Flutter (Channel master, v1.14.7-pre.45, on Microsoft Windows [Version 10.0.17763.914], locale en-US)
  2. Flutter version 1.14.7-pre.45 at c:\sdk\flutter
  3. Framework revision 9375377fa9 (2 hours ago), 2020-01-30 09:36:41 -0800
  4. Engine revision f6526c0cf8
  5. Dart version 2.8.0 (build 2.8.0-dev.6.0 fc3af737c7)
  6. [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
  7. Android SDK at C:\Users\pfernandes\AppData\Local\Android\sdk
  8. Android NDK location not configured (optional; useful for native profiling support)
  9. Platform android-29, build-tools 29.0.2
  10. Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
  11. Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
  12. All Android licenses accepted.
  13. [√] Android Studio (version 3.5)
  14. Android Studio at C:\Program Files\Android\Android Studio
  15. Flutter plugin version 42.1.1
  16. Dart plugin version 191.8593
  17. Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
  18. [√] VS Code, 64-bit edition (version 1.41.1)
  19. VS Code at C:\Program Files\Microsoft VS Code
  20. Flutter extension version 3.7.1
  21. [√] Connected device (1 available)
  22. N910 0123456789ABCDEF android-arm Android 5.1.1 (API 22)
  23. No issues found!
oipij1gg

oipij1gg1#

更新VSCode帮助我解决了这个问题!尝试更新VSCode。

bihw5rsg

bihw5rsg2#

在你将你的应用程序迁移到AndroidX后再试一次,它对我很有效。
You can follow this doc to learn more about AndroidX migration

wf82jlnq

wf82jlnq3#

此问题需要固件更新才能解决。

sqserrrh

sqserrrh4#

在android sdk中的platform-tools中打开cmd并编写以下命令adb shell am clear-debug-app

相关问题