赞
踩
鸿蒙打包Flutter为HAP流程简介,官方文档可访问OpenHarmony-SIG / flutter_flutter
export OHPM_HOME=/home/<user>/ohos/oh-command-line-tools/ohpm/
export PATH= $PATH:$OHPM_HOME/bin:$OHPM_HOME/sdkmanager/bin
#这里的flutter sdk路径为你下载的鸿蒙的flutter sdk的路径,并且需要切换到最新分支代码
export PATH=<flutter_flutter path>/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
flutter create --platforms ohos <projectName>
cd /Users/kk/Desktop/develop/project/hmosdemo
flutter build hap --local-engine=/Users/kk/Desktop/develop/project/hm_demo/engine-mac-arm64/src/out/ohos_debug_unopt_arm64
flutter run --local-engine=<flutter_engine out path>
虽然非常不建议大家自己去构建Flutter Engine, 但是还是补充一下构建的步骤
brew install python3
brew install pkg-config
brew install ninja-build
export NODE_HOME=/home/<user>/env/node-v14.19.1-linux-x64
export PATH=$NODE_HOME/bin:$PATH
solutions = [
{
"managed": False,
"name": "src/flutter",
"url": "git@gitee.com:openharmony-sig/flutter_engine.git",
"custom_deps": {},
"deps_file": "DEPS",
"safesync_url": "",
},
]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。