windows10下安装flutter出现的问题
Posted 我叫白小飞
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了windows10下安装flutter出现的问题相关的知识,希望对你有一定的参考价值。
执行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.
此时就已安装成功!
以上是关于windows10下安装flutter出现的问题的主要内容,如果未能解决你的问题,请参考以下文章
在 Windows 10 上使用 Android Studio 开发 Flutter 应用程序出现“无法定位 adb”
React Native 和 Flutter 安装 Windows 10 上无效的 JAVA_HOME 目录