D:\Flutter\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.22631.3296], locale zh-CN)
• Flutter version 1.2.1 at D:\Flutter\flutter
• Framework revision 8661d8aecd (5 years ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390fa4
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
Process finished with exit code 1Android sdkmanager tool not found (D:\AndroidSDK\tools\bin\sdkmanager).
Try re-installing or updating your Android SDK,
visit https://flutter.io/setup/#android-setup for detailed instructions.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:24:3)
#1 AndroidLicenseValidator._ensureCanRunSdkManager (package:flutter_tools/src/android/android_workflow.dart:313:7)
#2 AndroidLicenseValidator.licensesAccepted (package:flutter_tools/src/android/android_workflow.dart:252:5)
<asynchronous suspension>
#3 AndroidLicenseValidator.validate (package:flutter_tools/src/android/android_workflow.dart:189:19)
<asynchronous suspension>
#4 GroupedValidator.validate (package:flutter_tools/src/doctor.dart:318:52)
#5 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#6 GroupedValidator.validate (package:flutter_tools/src/doctor.dart:315:36)
#7 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:116:52)
#8 Doctor.diagnose (package:flutter_tools/src/doctor.dart:189:41)
#9 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#10 Doctor.diagnose (package:flutter_tools/src/doctor.dart:179:24)
#11 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:48:39)
#12 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#13 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:34:42)
#14 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:545:18)
#15 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#16 _rootRunUnary (dart:async/zone.dart:1132:38)
#17 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#18 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#19 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#20 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#21 Future._complete (dart:async/future_impl.dart:473:7)
#22 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#23 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#24 _rootRun (dart:async/zone.dart:1124:13)
#25 _CustomZone.run (dart:async/zone.dart:1021:19)
#26 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#27 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#28 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#29 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#30 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
将Hide Obsolete Packages这个选项勾选取消掉。默认是勾选的。是看不见的。
进入发现没有Android SDK Tools(Obsolete),重启As也不显示,然后重启了下电脑出现该选项了。
可以多试几次,如果还是不行的话,可以参考链接
执行命令 flutter doctor
在执行 flutter doctor --android-licenses
A newer version of the Android SDK is required. To update, run:
D:\AndroidSDK\tools\bin\sdkmanager --update
报错信息
D:\AndroidSDK\tools\bin>sdkmanager --update
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 5 more
参考
Github官网