调试Flutter应用在小米设备上无法在VSCode中工作。

huangapple go评论86阅读模式
英文:

Debug Flutter app is not working with VSCode on Xiaomi Device

问题

我正在使用VSCode IDE开发移动应用程序,使用Flutter。我在三星设备上进行调试时一切正常,但尝试在小米设备上调试时出现错误。

> 在调试模式下启动lib/main.dart上的166216e0...
> 构建build/app/outputs/flutter-apk/app-debug.apk。
> adb:设备权限不足:缺少udev规则?用户在plugdev组中
> 请参阅[http://developer.android.com/tools/device.html]获取更多信息
> 错误:ADB以退出代码1退出
> adb:设备权限不足:缺少udev规则?用户在plugdev组中
> 请参阅[http://developer.android.com/tools/device.html]获取更多信息
> 在166216e0上启动应用程序时出现错误。
> 退出(sigterm)

三星设备使用的是Android 11,而小米设备使用的是MIUI Global 12.0.4 Android 10。

除了启用USB调试之外,我还启用了通过USB安装和USB调试的选项。

我不知道该如何解决这个问题。有什么建议吗?

我已经通过SDK Manager添加了Android 10:

调试Flutter应用在小米设备上无法在VSCode中工作。

之后我运行了以下命令:

flutter doctor --android-licenses

但问题仍然没有解决。

英文:

I'm starting developing mobile using flutter on vscode IDE. I was debbuging the app using a samsung device, everything was ok, but I tryed debug the app using a xiaomi device, however this time i've got an error

> Launching lib/main.dart on 166216e0 in debug mode...
> Built build/app/outputs/flutter-apk/app-debug.apk.
> adb: insufficient permissions for device: missing udev rules? user is in the plugdev group
> See [http://developer.android.com/tools/device.html] for more information
> Error: ADB exited with exit code 1
> adb: insufficient permissions for device: missing udev rules? user is in the plugdev group
> See [http://developer.android.com/tools/device.html] for more information
> Error launching application on 166216e0.
> Exited (sigterm)

There's a difference of android version. Samsung is android 11 and xiaomi is a MIUI Global 12.0.4 android 10.

apart from having usb debug enabled, i've enabled the option to install via usb and usb debugging.

I don't know how to solve this. Any suggestion?

I've updated SDK Manager adding android 10

调试Flutter应用在小米设备上无法在VSCode中工作。

after that i runned
flutter doctor --android-licenses
but I still not working

答案1

得分: 1

修复方法是将手机设置为文件传输模式或PTP模式。您需要将USB连接模式从“充电此手机”更改为“PTP”(图片传输协议)。

英文:

fix would be to set the phone to File Transfer mode or PTP mode.so you have to change it from USB "Charge this phone" to "PTP" (Picture Transfer Protocol).

huangapple
  • 本文由 发表于 2023年2月10日 05:08:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75404430.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定