HarmonyOS flutter_flutter开发环境搭建问题

依据HarmonyOS化指导文档:https://gitee.com/openharmony-sig/flutter_samples/tree/master/ohos/docs搭建HarmonyOS Flutter开发环境,检查HarmonyOS配置时(flutter doctor -v),未检查到HarmonyOS Sdk,不知是哪里出了问题?

报错如下:

[X] HarmonyOS toolchain - develop for HarmonyOS devices
    X HarmonyOS Sdk not found;
      please do that, first: download from https://developer.harmonyos.com/cn/develop/deveco-studio#download_cli ;
      second: follow this document:
      https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/ide-command-line-ohsdkmgr-0000001545647965-V3
      to install OpenHarmony sdk with ohsdkmgr;
      If the Ohos SDK has been installed to a custom location, please use
      `flutter config --ohos-sdk` to update to that location.

      Ohpm version 5.0.1
      Node version v14.9.0
      Hvigorw binary at
      F:\OpenHarmony\commandline-Windows-5.0.3.401\commandline-Windows-5.0.3.401\commandline-tools-windows-x64-5.0.3.401
      \command-line-tools\bin\hvigorw.bat
HarmonyOS
1天前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Excelsior_abit

根据报错信息来看,这是环境变量没配置好导致的。DEVECO_SDK_HOME这个环境变量需要指向到DevEco-Studio 或 command-line-tools中的sdk目录。国内镜像:

export PUB_HOSTED_URL=https://pub.flutter-io.cn 
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn 

拉取下来的flutter_flutter/bin目录:

export PATH=/home/<user>/ohos/flutter_flutter/bin:$PATH 

HamonyOS SDK:

export TOOL_HOME=/Applications/DevEco-Studio-5.0.3.300.app/Contents # mac环境 
export DEVECO_SDK_HOME=$TOOL_HOME/sdk # command-line-tools/sdk 
export PATH=$TOOL_HOME/tools/ohpm/bin:$PATH # command-line-tools/ohpm/bin 
export PATH=$TOOL_HOME/tools/hvigor/bin:$PATH # command-line-tools/hvigor/bin 
export PATH=$TOOL_HOME/tools/node/bin:$PATH # command-line-tools/tool/node/bin
分享
微博
QQ
微信
回复
1天前
相关问题
内网开发环境搭建问题
208浏览 • 1回复 待解决
Flutter 开发资料相关问题
443浏览 • 1回复 待解决
HarmonyOS flutter plugin开发联调问题
42浏览 • 1回复 待解决
HarmonyOS Flutter项目开发相关问题
37浏览 • 1回复 待解决
HarmonyOS 关于flutter开发问题
29浏览 • 1回复 待解决
Flutter 如何判断是HarmonyOS环境
145浏览 • 1回复 待解决
HarmonyOS Flutter插件问题
35浏览 • 1回复 待解决
HarmonyOS引用flutter问题
26浏览 • 1回复 待解决
如何集成flutter开发框架?
185浏览 • 1回复 待解决
HarmonyOS flutter_inappwebview问题
51浏览 • 1回复 待解决
Flutter - EventChannel回调问题
203浏览 • 1回复 待解决
Flutter集成问题有哪些?
201浏览 • 1回复 待解决
HarmonyOS Flutter版本适配问题
43浏览 • 1回复 待解决
HarmonyOS flutter类的问题
43浏览 • 1回复 待解决
咨询下Flutter工程问题
254浏览 • 1回复 待解决
flutter混合遇到的问题
328浏览 • 1回复 待解决