无法在android studio上创建新的flutter项目,但出现错误=>在项目位置驱动器中找不到名为"pubspec.yaml"的文件 [英] unable to create new flutter project on android studio getting error => Could not find a file named “pubspec.yaml” at project location drive

查看:267
本文介绍了无法在android studio上创建新的flutter项目,但出现错误=>在项目位置驱动器中找不到名为"pubspec.yaml"的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过遵循Flutter文档来安装Flutter.这是我得到的错误=>找不到名为"pubspec.yaml"的文件;在"E:"中.pub获取失败(66;在"E:"中找不到名为"pubspec.yaml"的文件).当我检查项目目录(E:\ Fapplication)时,有一个名为项目名称(flutter_appp)的空文件夹,但是android studio也直接在项目位置的驱动器(E :)中创建了相同的文件夹(flutter_appp),其中包含所有内容该项目.flutter doctor -v检查并且还设置了环境变量,我也尝试在命令提示符下创建项目,但是导致类似的错误.我一定在犯一个我找不到的小错误,请帮忙.[

I installed flutter by following flutter documentation. This is the error I'm getting=> Could not find a file named "pubspec.yaml" in "E:". pub get failed (66; Could not find a file named "pubspec.yaml" in "E:". when I checked my project directory(E:\Fapplication) there was an empty folder with the project name(flutter_appp) but the android studio also created the same folder(flutter_appp) directly in the project location's drive(E:) with all contents of the project. flutter doctor -v checked and environment variable is also set and I also tried to create the project on command prompt but it resulted in a similar error. I must be doing a little mistake which I can't find, please help. [

推荐答案

这种情况在我身上已经发生过好几次了:

This has happened to me several times:

对我来说(OS X)最终解决的事情是删除发布服务器的缓存:

What's ultimately solved things for me (OS X) is deleting pub's cache:

sudo rm -Rf/Users//.pub-cache

sudo rm -Rf /Users//.pub-cache

此外,删除项目根目录中的packages目录:

Also, delete the packages directory in your project's root:

sudo rm -Rf软件包

sudo rm -Rf packages

然后,酒吧再次进入您的项目,但请确保您没有以root用户身份运行(whoami会告诉您,退出将使您离开那里).

Then pub gets again in your project(s), but make sure that you are not operating as root (a whoami will tell you, and an exit will get you out of there).

这篇关于无法在android studio上创建新的flutter项目,但出现错误=>在项目位置驱动器中找不到名为"pubspec.yaml"的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆