同步操作将从 OpenHarmony-SIG/flutter_engine 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Original warehouse source: https://github.com/flutter/engine
This warehouse is based on the extension of Flutter's official engine warehouse and can build a Flutter engine program that supports running on OpenHarmony devices.
Supports building in Linux and Mac, mainly building gen_snapshot for Window environment;
Please ensure that the current build environment can access the allowed_hosts field configured in the DEPS file.
Build a basic environment: please refer to the official website;
Basic libraries that need to be installed:
sudo apt install python3
sudo apt install pkg-config
sudo apt install ninja-build
Configure node: Download node
and unzip it, and configure it into environment variables:
# nodejs
export NODE_HOME=/home/<user>/env/node-v14.19.1-linux-x64
export PATH=$NODE_HOME/bin:$PATH
for Window environment: please refer to the official website; Chapter "Compiling for Windows"
Configuration file: Create an empty folder engine, create a new .gclient
file in the engine, and edit the file:
solutions = [
{
"managed": False,
"name": "src/flutter",
"url": "git@gitee.com:openharmony-sig/flutter_engine.git",
"custom_deps": {},
"deps_file": "DEPS",
"safesync_url": "",
},
]
Synchronize code: In the engine directory, execute gclient sync
; here the engine source code, official packages repository will be synchronized, and the ohos_setup task will be executed;
Download sdk: Download ohos-sdk-full in the daily build, configure the following environment variables:
export OHOS_SDK_HOME=<ohos-sdk-full>
Start building: In the engine directory, execute ./ohos
to start building the flutter engine that supports ohos devices.
Update project: In the engine directory, execute ./ohos -b master
When running the project, an error of Member notfound:'isOhos' is reported: Please ensure that all dart patches are applied in the src/third_party/dart directory (the patches are located in the src/flutter/attachment/repos directory, and you can use git apply to apply the patch). Recompile the engine after patching
Prompt Permission denied: Execute chmod +x <script file> to add execution permissions
Compile the engine in debug/release/profile mode separately: ./ohos -t debug|release|profile
See help: ./ohos -h
Edit shell/platform/ohos/flutter_embedding/local.properties:
sdk.dir=<OpenHarmony sdk directory>
nodejs.dir=<nodejs sdk directory>
In the shell/platform/ohos/flutter_embedding directory, execute
./hvigorw --mode module -p module=flutter@default -p product=default assembleHar --no-daemon
The har file output path is: shell/platform/ohos/flutter_embedding/flutter/build
ps: If you are using the Beta version of DevEco Studio and encounter the error "must have required property 'compatibleSdkVersion', location: build-profile.json5:17:11" when compiling the project, please refer to the "DevEco Studio Environment Configuration Guide." docx》Chapter '6 Creating Projects and Running Hello World' [Configuration Plugin] Modify the shell/platform/ohos/flutter_embedding/hvigor/hvigor-config.json5 file.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。