HarmonyOS flutter build报错

操作步骤:flutter build hap --local-engine ~/ohos/src/out/ohos_debug_unopt_arm64 --debug报错:

> hvigor ERROR: Cause: The SDK license agreement is not accepted.
Solution:
1. If you are in DevEco Studio, open SDK Manager, go to SDK > HarmonyOS, and
re-download the HarmonyOS NEXT Developer Preview2 SDK. Accept the license
agreement when prompted.
2. If you are using a pipeline, re-download the HarmonyOS NEXT Developer
Preview2 SDK with a command line tool. Accept the license agreement when
prompted.
  > hvigor ERROR: BUILD FAILED in 4 s 182 ms
error! when invoke: /Users/long/application/ohos/hvigorw clean assembleHap
--no-daemon ,exitCode = 255.
assembleHap error! please check log.
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
HarmonyOS
2024-12-28 07:44:10
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
zxjiu

根据提供的操作步骤,报错是The SDK license agreement is not accepted。

可以参考执行以下命令后再次编译:

./ohsdkmgr install ets:9 js:9 native:9 previewer:9 toolchains:9 --sdk-directory='/home/xc/code/sdk/ohos-sdk/' --accept-license 
  • 1.

参考文档:https://gitee.com/openharmony-sig/flutter_flutter#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

请参考文档配置环境变量:

export TOOL_HOME=/Applications/DevEco-Studio-5.0.3.300.app/Contents # mac环境 
export DEVECO_SDK_HOME=$TOOL_HOME/sdk # command-line-tools/sdk 
  • 1.
  • 2.

参考文档:https://gitee.com/openharmony-sig/flutter_flutter/tree/dev/#%E7%8E%AF%E5%A2%83%E4%BE%9D%E8%B5%96

分享
微博
QQ
微信
回复
2024-12-28 10:35:16


相关问题
HarmonyOS flutter build har fail
373浏览 • 1回复 待解决
HarmonyOS flutter build hap --debug编译失败
467浏览 • 1回复 待解决
Build Output文件报错
9072浏览 • 1回复 待解决
HarmonyOS 编译flutter报错
645浏览 • 1回复 待解决
build app 报错 Components state is illegal!
8019浏览 • 1回复 待解决
HarmonyOS Flutter run指令报错
710浏览 • 1回复 待解决
HarmonyOS webview_flutter报错
847浏览 • 1回复 待解决
flutter build hap 失败(mac intel i5)
1850浏览 • 1回复 待解决
HarmonyOS 创建Flutter demo运行报错
685浏览 • 1回复 待解决
HarmonyOS flutter plugin引用时git报错
667浏览 • 1回复 待解决
flutter url_launcher在HarmonyOS报错
598浏览 • 1回复 待解决
HarmonyOS 使用flutter创建packages时报错
548浏览 • 1回复 待解决
HarmonyOS DevEco调试Flutter项目时报错
371浏览 • 1回复 待解决
输入python build.py wifiiot报错怎么解决
10759浏览 • 1回复 待解决
HarmonyOS flutter依赖插件audio_session报错
387浏览 • 1回复 待解决
HarmonyOS 升级新版本flutter运行报错
530浏览 • 1回复 待解决