简体   繁体   English

如何修复“错误:找不到 pubspec.yaml 文件”。 在 flutter 和 Android 工作室?

[英]How do I fix "Error: No pubspec.yaml file found." in flutter w/ Android studio?

I've been looking and googling for a while and couldn't find a fitting answer, I've tried different commands through the terminal, as was suggested in some forums but nothing really helped.我一直在寻找和谷歌搜索一段时间,但找不到合适的答案,我已经通过终端尝试了不同的命令,正如某些论坛中所建议的那样,但没有任何帮助。 I have this issue for some reason only with a specific project, other flutter projects that I have are running with no issues at all由于某种原因,我只在特定项目中遇到此问题,我拥有的其他 flutter 项目正在运行,完全没有问题

For Example, I've tried to run this in the terminal and this is what I got:例如,我试图在终端中运行它,这就是我得到的:

Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project

Any help, suggestions, and recommendations would be much appreciated任何帮助、建议和建议将不胜感激

This problem is due to the fact that you are running the flutter run command from a different directory.此问题是由于您正在从不同的目录运行flutter run命令。 Usually, when you try this command, you are in the parent directory instead of the root directory.通常,当您尝试此命令时,您是在父目录而不是根目录中。

Try running the flutter run command from the project directory using the cd YOUR_ROOT_DIRECTORY command you can enter to that directory.尝试使用cd YOUR_ROOT_DIRECTORY命令从项目目录运行flutter run命令,您可以进入该目录。

decided to reinstall android studio and make sure that everything is correct with the PATH of the SDK, and reinstalled the SDK tools.决定重新安装 android studio 并确保 SDK 的 PATH 一切正确,并重新安装 SDK 工具。 pretty much worked for some reason由于某种原因几乎工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:找不到 pubspec.yaml 文件。 此命令应从 Flutter 项目的根目录运行 - Error: No pubspec.yaml file found. This command should be run from the root of your Flutter project 找不到 pubspec.yaml 文件。 此命令应从 Flutter 项目的根目录运行 - No pubspec.yaml file found. This command should be run from the root of your Flutter project 地理位置错误:如果我添加pubspec.yaml文件,则无法建立^ 3.0.0,无法构建android应用 - Getting Error With geolocator: ^3.0.0 in flutter if i add in pubspec.yaml file, not able to build android app Flutter pubspec.yaml Android版本代码 - Flutter pubspec.yaml Android versionCode 在flutter中,如何将tfl​​ite添加为pubspec.yaml文件中的依赖项? - In flutter, How to add tflite as a dependency in pubspec.yaml ?file? 为什么 Android Studio - Flutter 在 pubspec.yaml 在 Z1D41C850AF58D3ADACEZ5 中进行任何更改后一直卡住 - Why does Android Studio - Flutter keep getting stuck after making any change in pubspec.yaml in ubuntu 在 Flutter pubspec.yaml 文件中将版本更新为 1.1.0+3 但在上传到 playConsole 时,仍然错误版本代码 1 - In Flutter pubspec.yaml file updated the version to 1.1.0+3 but on uploading to playConsole, still error version code 1 我想在flutter应用程序中添加字体,但pubspec.yaml中有问题 - i want to add fonts in flutter app, but there is a problem in pubspec.yaml 为什么在 pubspec.yaml 中添加 firebase_admob: ^0.11.0+1 运行时会产生错误(Flutter,Android) - Why adding firebase_admob: ^0.11.0+1 in pubspec.yaml generats error when run (Flutter, Android) 在依赖项中发现了显示不兼容类的 AudioPlayers 包 (Flutter)。 我在下面附上了整个 main.dart 和 pubspec.yaml 文件 - AudioPlayers package (Flutter) showing Incompaitble classes were found in dependencies. I attached the whole main.dart and pubspec.yaml file below
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM