android - Flutter doctor 终端命令不起作用

标签 android flutter

$ Flutter doctor 终端命令无法在 ubuntu 上运行,给出错误消息“curl: (35) gnutls_handshake() failed: 拉函数错误。 "

最佳答案

我使用的是 Ubuntu 18.04 LTS。假设您已成功下载并解压 flutter_linux_v0.5.1-beta.tar.xz (最新更新到现在)到您的首选目录。

export PATH=`pwd`/flutter/bin:$PATH

在您的 ubuntu 终端 (Ctrl + Alt + T) 中运行此命令会将 flutter 命令 PATH 变量添加到您的系统路径中以用于临时 session 。一旦关闭终端,系统路径就会被删除。

为了让 ubuntu 终端永久记住 flutter 命令,你需要:

1.) open up terminal and cd to $HOME. for eg: user@linux:~$

2.) open the hidden file .bashrc with your desired editor. It resides in $HOME.

3.) add the following line export PATH=/home/yourname/flutter/bin:$PATH somewhere as a newline in .bashrc file preferably as a last line edit & save file.

4.) run source /home/yourname/.bashrc in terminal to process your recent changes.

5.) finally, run echo $PATH to see flutter dir is in your system path along with other such paths. for eg: /home/yourname/flutter/bin

现在关闭当前终端并重新打开新终端以检查 flutter doctor。从现在开始,它应该每次都与所有其他可用的 flutter 命令一起处理。谢谢 ! :)

关于android - Flutter doctor 终端命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49319383/

相关文章:

firebase - 最佳实践 : Display data from Firebase in Flutter

flutter - 如何防止键盘向上移动堆栈中的其他小部件? ( flutter )

java - java对象转字符串数组

java - 如何在Canvas中绘制图标或类似内容?

android - 在 Flutter 应用程序 Targeting S+(版本 31 及更高版本)中,需要在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一

xcode - 如何在 Xcode 中设置 Flutter 构建选项

flutter - 运行 flutter web 时出现错误,FormatException : Unexpected character (at character 1) <html>

android - 在第一次启动时创建 SQL 数据库并在下次启动时检索数据库数据

android - 未捕获的异常不起作用

flutter - 如果没有结果,则处理 streambuilder