【问题标题】:Flutter - Physical device is connected with USB debugging on but still shows "no devices connected"Flutter - 物理设备已连接 USB 调试,但仍显示“未连接设备”
【发布时间】:2021-07-10 15:03:42
【问题描述】:

问题:我连接了物理设备,启用了开发者选项,也启用了 USB 调试,还安装了 android SDK,但是当我执行 flutter run 时,它仍然显示“未连接或找到任何设备” .

我之前尝试过的:我从早上开始就一直在研究和发现,但问题仍然没有解决。

我也尝试运行 flutter devices --verbose 并得到以下输出。

[ +130 ms] executing: [C:\Src\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +114 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] b1395592de68cc8ac4522094ae59956dd21a91db
[   +1 ms] executing: [C:\Src\flutter/] git tag --points-at b1395592de68cc8ac4522094ae59956dd21a91db
[  +71 ms] Exit code 0 from: git tag --points-at b1395592de68cc8ac4522094ae59956dd21a91db
[   +1 ms] 2.0.4
[  +85 ms] executing: [C:\Src\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +62 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\Src\flutter/] git ls-remote --get-url origin
[  +46 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +126 ms] executing: [C:\Src\flutter/] git rev-parse --abbrev-ref HEAD
[  +50 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[ +214 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +136 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +56 ms] executing: C:\Users\Mit\AppData\Local\Android\Sdk\platform-tools\adb.exe devices -l
[  +87 ms] List of devices attached
[   +9 ms] No devices detected.

           Run "flutter emulators" to list and start any available device emulators.

           If you expected your device to be detected, please run "flutter doctor" to diagnose potential
           issues. You
           may also try increasing the time to wait for connected devices with the --device-timeout flag.
           Visit
           https://flutter.dev/setup/ for troubleshooting tips.
[   +6 ms] executing: C:\Users\Mit\AppData\Local\Android\Sdk\platform-tools\adb.exe devices -l
[  +67 ms] List of devices attached
[  +21 ms] "flutter devices" took 464ms.
[ +244 ms] ensureAnalyticsSent: 232ms
[   +2 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[   +1 ms] exiting with code 0```

Any help would be much appreciated. Thank you

【问题讨论】:

  • 能否提供flutter devices的结果?
  • @Nuts 是的,当然!颤动设备 未检测到设备。运行“flutter emulators”以列出并启动任何可用的设备模拟器。如果您希望您的设备被检测到,请运行“flutter doctor”来诊断潜在问题。您也可以尝试使用 --device-timeout 标志增加等待连接设备的时间。请访问 flutter.dev/setup 获取故障排除提示。

标签: flutter


【解决方案1】:

可能有多种原因,例如与设备的连接可能未经授权。 尝试在终端运行adb devices,输出会显示是否检测到并正确连接。

【讨论】:

  • 嘿,当我在终端执行此命令时,它说 adb 未被识别为内部或外部命令。
猜你喜欢
  • 2011-04-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多