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.
HarmonyOS
8天前
浏览
收藏 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 

参考文档: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 

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

分享
微博
QQ
微信
回复
8天前
相关问题
Build Output文件报错
8563浏览 • 1回复 待解决
HarmonyOS 编译flutter报错
175浏览 • 1回复 待解决
HarmonyOS webview_flutter报错
238浏览 • 1回复 待解决
HarmonyOS Flutter run指令报错
168浏览 • 1回复 待解决
flutter build hap 失败(mac intel i5)
1346浏览 • 1回复 待解决
build app 报错 Components state is illegal!
7457浏览 • 1回复 待解决
HarmonyOS 创建Flutter demo运行报错
196浏览 • 1回复 待解决
HarmonyOS flutter plugin引用时git报错
194浏览 • 1回复 待解决
HarmonyOS 使用flutter创建packages时报错
137浏览 • 1回复 待解决
flutter url_launcher在HarmonyOS报错
193浏览 • 1回复 待解决
输入python build.py wifiiot报错怎么解决
10019浏览 • 1回复 待解决
HarmonyOS flutter_flutter项目进展
107浏览 • 1回复 待解决
HarmonyOS 如何build har包
112浏览 • 1回复 待解决