博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Flutter环境配置
阅读量:5897 次
发布时间:2019-06-19

本文共 3816 字,大约阅读时间需要 12 分钟。

Flutter官网 https://flutterchina.club/

Flutter下载

配置国内镜像

配置Flutter环境变量

运行Flutter命令

win + R 快捷键,输入cmd,回车,输入flutter doctor,回车。

Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[X] Android toolchain - develop for Android devices    X Unable to locate Android SDK.      Install Android Studio from: https://developer.android.com/studio/index.html      On first launch it will assist you in installing the Android SDK components.      (or visit https://flutter.io/setup/#android-setup for detailed instructions).      If Android SDK has been installed to a custom location, set ANDROID_HOME to that location.      You may also want to add it to your PATH environment variable.[!] Android Studio (not installed)[!] Connected device    ! No devices available! Doctor found issues in 3 categories.PS C:\Users\boy> ^CPS C:\Users\boy>复制代码

报错

[X] If Android SDK has been installed to a custom location, set ANDROID_HOME to that location.      You may also want to add it to your PATH environment variable.复制代码

解决问题 配置ANDROID_HOME环境变量并且添加到path

运行 flutter doctor

Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)[!] Android Studio (not installed)[!] Connected device    ! No devices available复制代码

报错

[!] Android Studio (not installed)复制代码

解决方案:下载最新的Android Studio,自行安装即可。 https://developer.android.google.cn/studio

运行 flutter doctor

Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)[!] Android Studio (version 3.3)    X Flutter plugin not installed; this adds Flutter specific functionality.    X Dart plugin not installed; this adds Dart specific functionality.[!] IntelliJ IDEA Ultimate Edition (version 2018.2)    X Flutter plugin not installed; this adds Flutter specific functionality.    X Dart plugin not installed; this adds Dart specific functionality.[√] Connected device (1 available)复制代码

报错

[!] Android Studio (version 3.3)    X Flutter plugin not installed; this adds Flutter specific functionality.    X Dart plugin not installed; this adds Dart specific functionality.复制代码

解决方案 需要安装两个插件:

  • Flutter插件: 支持Flutter开发工作流 (运行、调试、热重载等).
  • Dart插件: 提供代码分析 (输入代码时进行验证、代码补全等).

要安装这些:

启动Android Studio.

  1. 打开插件首选项 (Preferences>Plugins on macOS, File>Settings>Plugins on Windows & Linux).
  2. 选择 Browse repositories…, 选择 Flutter 插件并点击 install.
  3. 重启Android Studio后插件生效.

具体安装如下:

运行 flutter doctor

Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)[√] Android Studio (version 3.3)[!] IntelliJ IDEA Ultimate Edition (version 2018.2)    X Flutter plugin not installed; this adds Flutter specific functionality.    X Dart plugin not installed; this adds Dart specific functionality.[√] Connected device (1 available)! Doctor found issues in 1 category.复制代码

[!] IntelliJ IDEA Ultimate Edition (version 2018.2)这个是IntelliJ IDEA编译器,我们只要Android Studio可用就好,大家忽视就好。

创建Flutter项目

运行Flutter工程

转载于:https://juejin.im/post/5c83262de51d45365477e08d

你可能感兴趣的文章
codeforces 960C Subsequence Counting
查看>>
【11】ajax请求后台接口数据与返回值处理js写法
查看>>
Python菜鸟之路:Jquery Ajax的使用
查看>>
LeetCode算法题-Maximum Depth of Binary Tree
查看>>
sha1withRSA算法
查看>>
让简历一发即中三大绝招
查看>>
Vim和操作系统剪贴板交互
查看>>
使用ExposedObject对Asp.net MVC中匿名类型的JsonResult做单元测试
查看>>
ajax省市县联动
查看>>
Cox 教学视频5
查看>>
014-请问你觉得测试项目具体工作是什么?
查看>>
JVM类加载(4)—加载器
查看>>
public/private/protected的具体区别
查看>>
面试宝典——求一个字符串中连续出现次数最多的子串
查看>>
VMware Workstation虚拟机上网设置
查看>>
Jenkins持续集成学习-搭建jenkins问题汇总
查看>>
leetcode:Invert Binary Tree
查看>>
C#Note13:如何在C#中调用python
查看>>
Android介绍以及源码编译---Android源码下载
查看>>
SpringBoot集成redis缓存
查看>>