简体   繁体   English

路径 in.bash_profile 给出错误:“-bash:flutter:找不到命令”

[英]Path in .bash_profile give error: "-bash: flutter: command not found"

I am following Flutter official documentation for adding flutter Path in .bash_profile in order to run commands on terminal but it give me error -bash: flutter: command not found我正在关注 Flutter 官方文档以在.bash_profile中添加 flutter 路径以便在终端上运行命令但它给我错误-bash: flutter: command not found

Is there any quick way to add Flutter support in android studio for was Android Developers.有没有什么快速的方法可以在 android studio 中为 Android 开发人员添加 Flutter 支持。 I am trying to find the easy way to add Flutter support on running Android environment.我正在尝试找到在运行 Android 环境时添加 Flutter 支持的简单方法。

My.bash_profile contains the following line: export PATH="$PATH:$HOME/Developer/flutter/bin" My.bash_profile 包含以下行: export PATH="$PATH:$HOME/Developer/flutter/bin"

I have tried all my possible answers but no luck.我已经尝试了所有可能的答案,但没有运气。 PS I'm using bash not zsh any other. PS 我使用的是 bash 而不是 zsh。

I have faced the same issue.我遇到过同样的问题。 I assume that you've downloaded the flutter SDK from official docs as I did and tried so many solutions.我假设你已经像我一样从官方文档下载了 flutter SDK 并尝试了很多解决方案。

I resolved this issue with the following steps:我通过以下步骤解决了这个问题:

  1. download the Android Studio下载 Android Studio
  2. Open Android studio's preferences -> Plugins -> download flutter plugin打开Android工作室的首选项->插件->下载flutter插件
  3. File -> New -> Create New Flutter project文件 -> 新建 -> 新建 Flutter 项目
  4. In the next dialogue under the "Flutter SDK path" you can see install SDK... option (install the SDK from there at your desired location)在“Flutter SDK 路径”下的下一个对话框中,您可以看到安装 SDK...选项(从那里在您想要的位置安装 SDK)
  5. Once SDK is installed then update your.bash_profile with the newly downloaded SDK.安装 SDK 后,使用新下载的 SDK 更新 your.bash_profile。

Your.bash_profile should look something like this: Your.bash_profile 应该看起来像这样:

export PATH="$PATH:$HOME/Developer/flutter/bin"

在此处输入图像描述 在此处输入图像描述

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM