当前位置:   article > 正文

vscode搭建环境创建flutter项目_vscode创建flutter工程

vscode创建flutter工程

1.下载vscode(自行下载)

2.在vscode的应用商店中安装flutter插件和dart插件(在应用商店搜索框搜索即可)

3.下载android studio

4.下载flutter sdk

下载地址: https://flutter.dev/docs/development/tools/sdk/releases ,拼接到用户变量Path的后面(记得加分号;)就可以使用flutter命令了,比如我的是:

D:\flutter\flutter\bin

运行 flutter doctor命令

flutter doctor

该命令是用来查看是否还需要安装其它依赖,如果需要,安装它们

5.在android studio中下载安卓模拟器

6.回到vscode,ctrl+shift+p,输入new project,选中flutter new project创建flutter项目

7.等待项目创建完成后,切换到lib/main.dart文件,按F5,选中弹出的安卓模拟器(就是刚刚在android studio上下载的)

8.等待调试完成后,项目就创建完成了

PS:项目调试的过程中遇到了一个问题

  1. FAILURE: Build failed with an exception.
  2. * What went wrong:
  3. Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
  4. > Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
  5. > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32/x86_debug-1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32.pom'.
  6. > Connect to storage.googleapis.com:443 [storage.googleapis.com/34.64.4.80] failed: Connection timed out: connect
  7. * Get more help at https://help.gradle.org

这里有解决方法:https://blog.csdn.net/jiayang_Sir/article/details/106355682

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/231833
推荐阅读
相关标签
  

闽ICP备14008679号