简体   繁体   English

为什么我得到这个程序 'flutter.bat' 无法运行:系统找不到指定的文件在 line:1 char:1

[英]Why I am getting this Program 'flutter.bat' failed to run: The system cannot find the file specifiedAt line:1 char:1

在此处输入图像描述

I am trying to create a flutter application in Visual Studio code which raising the above error.我正在尝试在 Visual Studio 代码中创建一个 flutter 应用程序,这会引发上述错误。

在此处输入图像描述

Sound to me like you have not installed flutter SDK properly or VS code is having problems finding the SDk path.对我来说听起来像您没有正确安装 flutter SDK 或 VS 代码在查找 SDk 路径时遇到问题。 it can be any of those things.它可以是任何这些东西。

it seems you have not accepted all android licenses.看来您还没有接受所有 android 许可证。 try reinstalling android SDK and make sure to accept all android licenses.尝试重新安装 android SDK 并确保接受所有 android 许可证。 then run然后运行

flutter doctor

and see if it passes all checks看看它是否通过了所有检查

Since you have installed Flutter for the first time, you need to accept Android License to start building with Flutter.由于您是第一次安装 Flutter,您需要接受 Android 许可证才能开始使用 Flutter 进行构建。

To accept the license,要接受许可,

  1. Open the terminal打开终端
  2. Type flutter doctor --android-licenses类型flutter doctor --android-licenses
  3. Press y to accept every license.y接受每个许可证。

This may be because your cmd.exe file located in system32 has been corrupted or lost.这可能是因为您位于 system32 中的 cmd.exe 文件已损坏或丢失。 Try to get the cmd.exe file from another system and paste it into the desired location then execute if there is a flutter in your system or not.尝试从另一个系统中获取 cmd.exe 文件并将其粘贴到所需的位置,然后在您的系统中是否存在 flutter 时执行。 This has solved the problem in my case.这解决了我的问题。

暂无
暂无

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

相关问题 无法在 Android Studio 上运行程序 flutter.bat - Cannot run program flutter.bat on Android Studio 为什么我在运行后在 Flutter 上收到“无法执行 aapt”错误? - Why am I getting "Failed to execute aapt" error on Flutter after run? 运行我的应用程序时,为什么会出现“由于APK文件无效导致安装失败!”的提示? - Why am I getting “Installation failed due to invalid APK file!” when I run my app? 任务 ':app:compileFlutterBuildDebug' 执行失败。> Process 'command 'C:\\src\\flutter\\bin\\flutter.bat'' 以非零退出值 1 完成 - Execution failed for task ':app:compileFlutterBuildDebug'.> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1 为什么在 Flutter 运行后出现此错误? - Why I am getting this error after Flutter Run? java.io.IOException: 无法运行程序 CreateProcess 错误=2,系统找不到在 android studio 上指定的文件 - java.io.IOException: Cannot run program CreateProcess error=2, The system cannot find the file specified on android studio Android Studio错误➡无法运行程序“ git” ... CreateProcess错误= 2,系统找不到指定的文件 - Android Studio error ➡ Cannot run program “git” … CreateProcess error=2, The system cannot find the file specified 为什么我无法在 android 中运行我的 flutter 项目,不断出现 gradle 错误? - why i am not able to run my flutter project in android constantly getting gradle error? 为什么我的Android程序第73行出现Null指针异常? - Why am I getting a Null Pointer Exception on my Android Program line 73? 为什么我在此行上收到NullPointerException? - Why am I getting a NullPointerException on this line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM