Flutter在Android Studio报告错误:ADB not found

1)首先确认ADB是可以执行的

C:\Users\Henry>adb devices
List of devices attached
9563ccxxx        device

2)Flutter doctor也是没有错误的

O:\work\flutter\flutter_windows_v1.2.1-stable\flutter\bin>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.648], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.2)
[√] Connected device (1 available)

• No issues found!

3) 但是打开Android studio就会报告 adb bridge not found, 还有就是adb not found

Flutter在Android Studio报告错误:ADB not found

 

4)原因是Android SDK没有在项目级别上设置好,进入File->Project instructure菜单,能看到 No SDK

Flutter在Android Studio报告错误:ADB not found

Flutter在Android Studio报告错误:ADB not found

5)纠正了就好了,也能在device explorer看到设备了

Flutter在Android Studio报告错误:ADB not found