我在调试flutter中新创建的项目时出错。这是出错前的日志。
[ +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
[ +696 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.mycompany.my_app_pos_payment_app/.MainActivity (has extras) }
[ ] Waiting for observatory port to be available...
[ +4 ms] Error waiting for a debug connection: Bad state: No element
[ ] Error launching application on N910.
我可以毫无问题地调试一个纯Android项目。
这是我的医生:
[√] Flutter (Channel master, v1.14.7-pre.45, on Microsoft Windows [Version 10.0.17763.914], locale en-US)
• Flutter version 1.14.7-pre.45 at c:\sdk\flutter
• Framework revision 9375377fa9 (2 hours ago), 2020-01-30 09:36:41 -0800
• Engine revision f6526c0cf8
• Dart version 2.8.0 (build 2.8.0-dev.6.0 fc3af737c7)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\pfernandes\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code, 64-bit edition (version 1.41.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.7.1
[√] Connected device (1 available)
• N910 • 0123456789ABCDEF • android-arm • Android 5.1.1 (API 22)
• No issues found!
4条答案
按热度按时间oipij1gg1#
更新VSCode帮助我解决了这个问题!尝试更新VSCode。
bihw5rsg2#
在你将你的应用程序迁移到AndroidX后再试一次,它对我很有效。
You can follow this doc to learn more about AndroidX migration
wf82jlnq3#
此问题需要固件更新才能解决。
sqserrrh4#
在android sdk中的platform-tools中打开cmd并编写以下命令adb shell am clear-debug-app