android - 调试时失去与设备的连接
问题描述
我使用 Visual Studio Code 作为 Flutter 开发的 IDE。我在 Android 模拟器 Pixel 2 API 28 上运行该应用程序。
问题:每当我尝试Flutter run
在 cmd 中运行命令时,我都会收到一条消息Lost connection to device
。
I/OpenGLRenderer( 8484): Davey! duration=1122ms; Flags=1,
IntendedVsync=6065658887920, Vsync=6066275554562,
OldestInputEvent=9223372036854775807, NewestInputEvent=0,
HandleInputStart=6066285882120, AnimationStart=6066285961770,
PerformTraversalsStart=6066287810650, DrawStart=6066297042570,
SyncQueued=6066299589490, SyncStart=6066304787990,
IssueDrawCommandsStart=6066305258460, SwapBuffers=6066689863430,
FrameCompleted=6066786911240, DequeueBufferDuration=43132000,
QueueBufferDuration=733000,
D/EGL_emulation( 8484): eglMakeCurrent: 0xcbb143c0: ver 3 0 (tinfo
0xe47d8860)
Lost connection to device.
Exited (sigterm)
我尝试运行我的应用程序时遇到的错误。这是我第一次遇到这个错误。我认为我没有更改任何会中断与我的设备连接的东西,或者错误可能来自其他地方。
解决方案
问题看起来像是在 IDE 中。我尝试清除模拟器中的数据,重新安装 Flutter,但似乎没有任何效果。
从 Visual Studio Code 切换到 Android Studio 解决了这个问题。
当我运行命令时,flutter run
我的应用程序在模拟器中运行良好。这对我来说是一个临时解决方案,因为我想切换回 Visual Studio Code,因为它是我选择的 IDE。
推荐阅读
- ios - 如何在 iOS 相机中制作镜像按钮?
- wpf - 更新 ObservableCollection 中的值
- powershell - 如何在 Windows 命令提示符或 Powershell 上计算浮点值的总和
- powershell - 在 Powershell 中使用哈希表
- go - Google Pub/Sub 消息排序不起作用(或将延迟增加到 10 秒以上)?
- python - Dimension mismatch in Keras sequence to sequence model with Attention
- r - 在 R Shiny 应用程序中渲染 ggplot2 和绘图对象
- json - 从属性到键值对的 Json 颠簸转换
- python - python插入Mariadb
- c++ - 为 x64 架构构建 ZeroMQ 库时未解决的外部错误,但在 32 位上运行良好