执行flutter doctor 后报错
C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, v0.10.1, on Microsoft Windows [Version 10.0.17134.345], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.2)
[!] IntelliJ IDEA Ultimate Edition (version 2018.1)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
分析:从错误中可以看出是IntelliJ IDEA 开发工具未安装flutter 和 dart 插件,因为我的电脑安装了as和idea两款开发工具,所以需要两款工具都安装插件。安装完成,重启之后再执行flutter doctor命令,出现如下错误:
C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, v0.10.1, on Microsoft Windows [Version 10.0.17134.345], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
X Android license status unknown.
[√] Android Studio (version 3.2)
[√] IntelliJ IDEA Ultimate Edition (version 2018.1)
[!] Connected device
! Doctor found issues in 2 categories.
然后再执行:flutter --android-licenses 命令:
C:\Users\Administrator>flutter doctor --android-licenses
Warning: Observed package id ‘build-tools;17.0.0’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\build-tools\android-4.2.2’ (Expected ‘D:\DevelopmentSoftwore\sdk\build-tools\17.0.0’)
Warning: Observed package id ‘system-images;android-17;default;armeabi-v7a’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\armeabi-v7a’ (Expected ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\armeabi-v7a’)
Warning: Observed package id ‘system-images;android-17;default;mips’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\mips’ (Expected ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\mips’)
Warning: Observed package id ‘system-images;android-17;default;x86’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\x86’ (Expected ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\x86’)
Warning: Already observed package id ‘system-images;android-17;default;x86’ in ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\x86’. Skipping duplicate at ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\x86’
Warning: Observed package id ‘build-tools;17.0.0’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\build-tools\android-4.2.2’ (Expected ‘D:\DevelopmentSoftwore\sdk\build-tools\17.0.0’)
Warning: Observed package id ‘system-images;android-17;default;armeabi-v7a’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\armeabi-v7a’ (Expected ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\armeabi-v7a’)
Warning: Observed package id ‘system-images;android-17;default;mips’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\mips’ (Expected ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\mips’)
Warning: Observed package id ‘system-images;android-17;default;x86’ in inconsistent location ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\x86’ (Expected ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\x86’)
Warning: Already observed package id ‘system-images;android-17;default;x86’ in ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\default\x86’. Skipping duplicate at ‘D:\DevelopmentSoftwore\sdk\system-images\android-17\x86’
Warning: File C:\Users\Administrator.android\repositories.cfg could not be loaded.
All SDK package licenses accepted.======] 100% Computing updates…
然后再执行:flutter doctor 命令:
C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, v0.10.1, on Microsoft Windows [Version 10.0.17134.345], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.2)
[√] IntelliJ IDEA Ultimate Edition (version 2018.1)
[!] Connected device
! Doctor found issues in 1 category.
此时就已安装成功!