Flutter开发HarmonyOS鸿蒙Next应用的时候如何设置环境变量"FLUTTER_GIT_URL"为https://gitee.com/openharmony-s...
Flutter开发HarmonyOS鸿蒙Next应用的时候如何设置环境变量"FLUTTER_GIT_URL"为https://gitee.com/openharmony-s…
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[!] Flutter (Channel master, 3.7.12-ohos-1.0.2, on Microsoft Windows [版本 10.0.22631.4317], locale zh-CN)
! Upstream repository https://gitee.com/openharmony-sig/flutter_flutter.git is not a standard remote.
Set environment variable “FLUTTER_GIT_URL” to https://gitee.com/openharmony-sig/flutter_flutter.git to dismiss
this error
在Flutter开发HarmonyOS鸿蒙Next应用时,设置环境变量"FLUTTER_GIT_URL"为指定的Gitee仓库地址,通常用于指定Flutter引擎或其他依赖的镜像源。以下是设置步骤:
-
打开终端:根据你的操作系统,打开命令行终端(Windows为CMD或PowerShell,macOS/Linux为Terminal)。
-
设置环境变量:
- Windows:在命令行输入
set FLUTTER_GIT_URL=https://gitee.com/openharmony-s...
(注意替换...
为实际路径)。此设置仅对当前终端会话有效,若要永久设置,需将此命令添加到系统环境变量中。 - macOS/Linux:在命令行输入
export FLUTTER_GIT_URL=https://gitee.com/openharmony-s...
(同样替换...
)。此设置对当前终端会话及其子进程有效,若要永久设置,可将其添加到~/.bashrc
或~/.zshrc
等shell配置文件中。
- Windows:在命令行输入
-
验证设置:通过输入
echo $FLUTTER_GIT_URL
(macOS/Linux)或echo %FLUTTER_GIT_URL%
(Windows)来验证环境变量是否设置成功。 -
重启终端(如果进行了永久设置):确保新的环境变量生效。
如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html