![](/img/trans.png)
[英]Flutter Unable to run "adb", check your Android SDK installation and ANDROID_SDK_ROOT environment variable
[英]Unable to run "adb", check your Android SDK installation and ANDROID_SDK_ROOT environment variable: ...\Android\Sdk\platform-tools\adb.exe
当我启动项目时,弹出窗口显示“Flutter daemon terminate”,当启动 flutter 应用程序时,它显示“未找到连接的设备”对话框。 然后我运行flutter doctor -v
医生发现问题:
Connected device (the doctor check crashed)
X Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
X Exception: Unable to run "adb", check your Android SDK installation and ANDROID_SDK_ROOT environment variable: C:\Users\Pulsara\AppData\Local\Android\Sdk\platform-tools\adb.exe
• #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 AndroidDevices.pollingGetDevices (package:flutter_tools/src/android/android_device_discovery.dart:78:7)
<asynchronous suspension>
#2 PollingDeviceDiscovery._populateDevices (package:flutter_tools/src/device.dart:413:54)
<asynchronous suspension>
#3 Future.wait.<anonymous closure> (dart:async/future.dart)
<asynchronous suspension>
#4 DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:170:40)
<asynchronous suspension>
#5 DeviceValidator.validate (package:flutter_tools/src/doctor.dart:515:34)
<asynchronous suspension>
#6 asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:24)
<asynchronous suspension>
我已经在用户变量和tools
中将 SDK 路径设置为 ANDROID_SDK_TOOLS ,并在路径中设置platform-tools
。 并重新安装了platform-tools
,但没有解决问题。 如果有人能给我一个解决方案,我想不出解决方案,我将不胜感激。
以下日志显示在事件日志中:
12/2/2021
12:26 AM 'C:\Users\Pulsara\AppData\Local\Android\Sdk\platform-
tools\adb.exe start-server' failed -- run manually if necessary
12:26 AM 'C:\Users\Pulsara\AppData\Local\Android\Sdk\platform-
tools\adb.exe start-server' failed -- run manually if necessary
12:26 AM * daemon not running; starting now at tcp:5037
12:26 AM * daemon started successfully
12:26 AM Adb connection Error:An existing connection was forcibly
closed by the remote host
12:26 AM Cannot reach ADB server, attempting to reconnect.
我仍然无法解决问题。
问题出在防病毒程序中。 它拒绝访问在port 5037
上启动 flutter 守护程序。 我只是从我的设备上卸载了防病毒程序。 然后它就像一个魅力。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.