flutter 环境搭建问题汇总


building flutter tool… 卡住

在命令行下,进入用户目录:执行命令 cd $HOME

打开.bash_profile文件:执行命令 open -e .bash_profile

文件打开后,开始编辑bash文件,在其中添加以下内容:

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
同时添加flutter相关工具到path中,也就是添加 Flutter SDK 安装的路径

export PATH=${PATH}:/Users/wujian/Flutter/flutter/bin:$PATH
关闭bash文件,配置完成后,更新配置的环境变量,执行命令: source .bash_profile
摘录于:https://zhuanlan.zhihu.com/p/48866181


集成文档
按照开发文档集成到当前项目时 方案1 pod install遇到

1
[!] No podspec found for `Flutter` in `../flutterModule/cbit_flutter/.ios/Flutter/engine`

先执行:flutter build ios 后再pod install


运行flutter的时候显示警告
Waiting for another flutter command to release the startup lock
复制代码当项目异常关闭,或者android studio用任务管理器强制关闭,下次启动就会出现上面的一行话,
此时需要打开 flutter/bin/cache/lockfile,删除就行了
或者直接用下面的命令:rm ./flutter/bin/cache/lockfile

作者:GabrielPanda
链接:https://juejin.im/post/6844903855751217160
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


Author

陈昭

Posted on

2020-04-08

Updated on

2021-12-27

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Kommentare

You forgot to set the shortname for Disqus. Please set it in _config.yml.