From f193832d2765374e9322d15930b60d2f254ea826 Mon Sep 17 00:00:00 2001 From: liuyuehu <3455278857@qq.com> Date: Thu, 4 Jul 2024 11:06:26 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=96=B0=E5=A2=9Eapp=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E6=8C=87=E5=AF=BC=20Signed-off-by:=20liuyuehu=20<3455278857@qq?= =?UTF-8?q?.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 0522c8c8a4..dcb8fa5c56 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,12 @@ Flutter SDK 仓库 flutter run --debug -d ``` +5. 构建app包命令: +``` + # 示例:flutter build app --release [--local-engine=/src/out/ohos_release_arm64] local-engine为可选项 + flutter build app --release +``` + ## 已兼容OpenHarmony开发的指令列表 | 指令名称 | 指令描述 | 使用说明 | -- Gitee From 96134cc89ba37532aea9f4a1a2ae3df66555e739 Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Fri, 5 Jul 2024 15:03:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=AF=8F=E6=AC=A1hvigorw=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E5=89=8D=E6=89=A7=E8=A1=8Cohpm=20clean=E5=92=8Cohpm=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hezhengyi --- README.en.md | 3 +- README.md | 3 +- .../flutter_tools/lib/src/ohos/hvigor.dart | 76 ++++++------------- 3 files changed, 29 insertions(+), 53 deletions(-) diff --git a/README.en.md b/README.en.md index 4fa188385d..69c88aa0ad 100644 --- a/README.en.md +++ b/README.en.md @@ -18,7 +18,8 @@ This repository is a compatible extension of Flutter SDK for the OpenHarmony pla *The following environment variable configuration is for Unix-like systems (Linux, Mac). You can directly refer to the configuration below. For environment variable configuration under Windows, please set it in ‘Edit System Environment Variables’* 1. Download OpenHarmony SDK and configure environment variables - * API12, deveco-studio-5.0.0.300 or command-line-tools-5.0.0.300 + * API12, deveco-studio-5.0.3.300 or command-line-tools-5.0.3.300 + * Configure Java17 * Configure environment variables (SDK, node, ohpm, hvigor) ```sh diff --git a/README.md b/README.md index 0522c8c8a4..caf42bbaa2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ Flutter SDK 仓库 *下列环境变量配置,类Unix系统(Linux、Mac),下可直接参照配置,Windows下环境变量配置请在‘编辑系统环境变量’中设置* 1. 配置HarmonyOS SDK和环境变量 - * API12, deveco-studio-5.0.0.300 或 command-line-tools-5.0.0.300 + * API12, deveco-studio-5.0.3.300 或 command-line-tools-5.0.3.300 + * 配置 Java17 * 配置环境变量 (SDK, node, ohpm, hvigor) ```sh diff --git a/packages/flutter_tools/lib/src/ohos/hvigor.dart b/packages/flutter_tools/lib/src/ohos/hvigor.dart index fe38736552..02c869184f 100644 --- a/packages/flutter_tools/lib/src/ohos/hvigor.dart +++ b/packages/flutter_tools/lib/src/ohos/hvigor.dart @@ -113,7 +113,7 @@ String getAbsolutePath(FlutterProject flutterProject, String path) { return path; } -Future invokeCmd( +Future invokeCmd( {required List command, required String workDirectory, required ProcessManager processManager, @@ -128,11 +128,7 @@ Future invokeCmd( .transform(utf8.decoder) .transform(const LineSplitter()) .listen((String line) { - if (line.contains('error')) { - throwToolExit('command {$command} invoke error!:$line'); - } else { - logger?.printStatus(line); - } + logger?.printStatus(line); }); final int exitCode = await server.exitCode; if (exitCode == 0) { @@ -140,7 +136,7 @@ Future invokeCmd( } else { logger?.printError('$cmd invoke error.'); } - return; + return server; } /// ohpm should init first @@ -148,29 +144,18 @@ Future ohpmInstall( {required ProcessManager processManager, required String workingDirectory, Logger? logger}) async { - final List command = [ - 'ohpm', - 'install', - '--all', - ]; - logger?.printTrace('invoke at:$workingDirectory ,command: ${command.join(' ')}'); - final Process server = - await processManager.start(command, workingDirectory: workingDirectory); - - server.stderr.transform(utf8.decoder).listen(logger?.printError); - final StdoutHandler stdoutHandler = - StdoutHandler(logger: logger!, fileSystem: globals.localFileSystem); - server.stdout - .transform(utf8.decoder) - .transform(const LineSplitter()) - .listen(stdoutHandler.handler); - final int exitCode = await server.exitCode; - if (exitCode == 0) { - logger.printStatus('ohpm install success.'); - } else { - logger.printError('ohpm install error.'); - } - return; + final List cleanCmd = ['ohpm', 'clean']; + final List installCmd = ['ohpm', 'install', '--all']; + await invokeCmd( + command: cleanCmd, + workDirectory: workingDirectory, + processManager: processManager, + logger: logger); + await invokeCmd( + command: installCmd, + workDirectory: workingDirectory, + processManager: processManager, + logger: logger); } /// 根据来源,替换关键字,输出target文件 @@ -186,23 +171,12 @@ Future hvigorwTask(List taskCommand, required String workPath, required String hvigorwPath, Logger? logger}) async { - final String taskStr = taskCommand.join(' '); - logger?.printTrace('invoke hvigorw task: $taskStr'); - final Process server = - await processManager.start(taskCommand, workingDirectory: workPath); - server.stderr.transform(utf8.decoder).listen(logger?.printError); - final StdoutHandler stdoutHandler = - StdoutHandler(logger: logger!, fileSystem: globals.localFileSystem); - server.stdout - .transform(utf8.decoder) - .transform(const LineSplitter()) - .listen(stdoutHandler.handler); - final int exitCode = await server.exitCode; - if (exitCode == 0) { - logger.printStatus('success! when invoke: $taskStr.'); - } else { - logger.printError('error! when invoke: $taskStr ,exitCode = $exitCode. '); - } + final Process process = await invokeCmd( + command: taskCommand, + workDirectory: workPath, + processManager: processManager, + logger: logger); + int exitCode = await process.exitCode; return exitCode; } @@ -643,16 +617,16 @@ class OhosHvigorBuilder implements OhosBuilder { // TODO: implement buildHsp throw UnimplementedError(); } - + @override Future buildApp({ required FlutterProject project, required OhosBuildInfo ohosBuildInfo, required String target, }) async { - + await buildApplicationPipeLine(project, ohosBuildInfo, target: target); - + final String hvigorwPath = getHvigorwPath(ohosRootPath, checkMod: true); /// invoke hvigow task generate hap file. @@ -665,7 +639,7 @@ class OhosHvigorBuilder implements OhosBuilder { throwToolExit('assembleHap error! please check log.'); } } - + Future buildApplicationPipeLine(FlutterProject flutterProject, OhosBuildInfo ohosBuildInfo, {required String target}) async { if (!flutterProject.ohos.ohosBuildData.moduleInfo.hasEntryModule) { throwToolExit( -- Gitee From f9bc6b37e30037f9d37b0370e2f8b3113791d0d5 Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Mon, 8 Jul 2024 20:19:23 +0800 Subject: [PATCH 3/8] Update engine.ohos.version to 18e8feda Signed-off-by: hezhengyi --- bin/internal/engine.ohos.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/internal/engine.ohos.version b/bin/internal/engine.ohos.version index b15f39a9e5..080e9e6df4 100644 --- a/bin/internal/engine.ohos.version +++ b/bin/internal/engine.ohos.version @@ -1 +1 @@ -18a0a1af65ac8d9448d7599cf86a7ccc96a0b13c +18e8feda3f19021381c2ed0abdbd7e6cd386b868 -- Gitee From 0dd428b042b653deb07084657ea232f2f451aab6 Mon Sep 17 00:00:00 2001 From: shinyxhh <9450ave@163.com> Date: Thu, 11 Jul 2024 16:34:31 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20#IACB3V=20=E4=BF=AE=E5=A4=8Dohos?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E9=87=8D=E7=BD=AEscrollBehavior=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=AF=A5=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/flutter/lib/src/widgets/scroll_view.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/widgets/scroll_view.dart b/packages/flutter/lib/src/widgets/scroll_view.dart index 0fcb1f5346..efa8d74904 100644 --- a/packages/flutter/lib/src/widgets/scroll_view.dart +++ b/packages/flutter/lib/src/widgets/scroll_view.dart @@ -414,16 +414,13 @@ abstract class ScrollView extends StatelessWidget { final ScrollController? scrollController = effectivePrimary ? PrimaryScrollController.maybeOf(context) : controller; - ScrollBehavior? localScrollBehavior = scrollBehavior; - if(defaultTargetPlatform == TargetPlatform.ohos){ - localScrollBehavior = ScrollConfiguration.of(context).copyWith(scrollbars:false); - } + final Scrollable scrollable = Scrollable( dragStartBehavior: dragStartBehavior, axisDirection: axisDirection, controller: scrollController, physics: physics, - scrollBehavior: localScrollBehavior, + scrollBehavior: scrollBehavior, semanticChildCount: semanticChildCount, restorationId: restorationId, viewportBuilder: (BuildContext context, ViewportOffset offset) { -- Gitee From 3f4f67e8c9ee5555b47ab2e08d52e8d83af5f05f Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Mon, 15 Jul 2024 17:05:43 +0800 Subject: [PATCH 5/8] Update engine.ohos.version to 8a718fcc Signed-off-by: hezhengyi --- bin/internal/engine.ohos.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/internal/engine.ohos.version b/bin/internal/engine.ohos.version index 080e9e6df4..82aaca1b63 100644 --- a/bin/internal/engine.ohos.version +++ b/bin/internal/engine.ohos.version @@ -1 +1 @@ -18e8feda3f19021381c2ed0abdbd7e6cd386b868 +8a718fcc06b1c5c283cdaa60884fb81093240a80 -- Gitee From e7ef51d75a98bda69dac5869b64972b358dbe40e Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Mon, 22 Jul 2024 11:14:38 +0800 Subject: [PATCH 6/8] Update engine.ohos.versiont to 5006f157 Signed-off-by: hezhengyi --- bin/internal/engine.ohos.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/internal/engine.ohos.version b/bin/internal/engine.ohos.version index 82aaca1b63..c5001676dc 100644 --- a/bin/internal/engine.ohos.version +++ b/bin/internal/engine.ohos.version @@ -1 +1 @@ -8a718fcc06b1c5c283cdaa60884fb81093240a80 +5006f157d46a85aecab64d80dbdf91fe3cda873b -- Gitee From dfd293ef80ca47de06206e55af13c77431c01024 Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Mon, 22 Jul 2024 11:15:04 +0800 Subject: [PATCH 7/8] Update readme Signed-off-by: hezhengyi --- README.en.md | 3 +++ README.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/README.en.md b/README.en.md index 69c88aa0ad..9017258491 100644 --- a/README.en.md +++ b/README.en.md @@ -165,3 +165,6 @@ Attachment: [Flutter third-party library adaptation plan](https://docs.qq.com/sh 2. Execute `fluent clean` to clear the project compilation cache 3. Execute `flutter run -d $DEVICE --debug` 3. Additional information: If a similar error occurs while running Android or iOS, you can also try restoring the environment variable FLUTTER_STORAGE_BASE_URL , clearing the cache, and then running again. + +12. After the ROM update in Beta 2 version, anonymous memory requests are no longer supported. Due to this change, the debug mode of Flutter application will crash. Please use release or profile mode first. + 1. Reference Documents: [Explanation of Change in Anonymous Memory Execution Permission Control Policy](https://developer.huawei.com/consumer/cn/doc/harmonyos-roadmap-V5/changelogs-for-all-apps-b031-V5#%E5%8C%BF%E5%90%8D%E5%86%85%E5%AD%98%E6%89%A7%E8%A1%8C%E6%9D%83%E9%99%90%E7%AE%A1%E6%8E%A7%E7%AD%96%E7%95%A5%E5%8F%98%E6%9B%B4%E8%AF%B4%E6%98%8E) diff --git a/README.md b/README.md index 257fab7e8e..7e0e3cc70c 100644 --- a/README.md +++ b/README.md @@ -180,3 +180,5 @@ Flutter SDK 仓库 4. 运行 `flutter run -d $DEVICE --debug` 3. 补充信息: 运行android或ios出现类似错误,也可以尝试还原环境变量 FLUTTER_STORAGE_BASE_URL ,清除缓存后重新运行。 +11. Beta2版本的ROM更新后,不再支持申请匿名内存。受此次变更影响,flutter应用的debug模式运行会闪退,请先使用release或profile运行模式。 + 1. 参考文档:[匿名内存执行权限管控策略变更说明](https://developer.huawei.com/consumer/cn/doc/harmonyos-roadmap-V5/changelogs-for-all-apps-b031-V5#%E5%8C%BF%E5%90%8D%E5%86%85%E5%AD%98%E6%89%A7%E8%A1%8C%E6%9D%83%E9%99%90%E7%AE%A1%E6%8E%A7%E7%AD%96%E7%95%A5%E5%8F%98%E6%9B%B4%E8%AF%B4%E6%98%8E) -- Gitee From 5112106a1f0bcee7e15b028ae2dd084a36f3a246 Mon Sep 17 00:00:00 2001 From: cjand <1747143535@qq.com> Date: Mon, 22 Jul 2024 17:06:06 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8Materia?= =?UTF-8?q?lApp=E6=97=B6=EF=BC=8CFlex=E5=B8=83=E5=B1=80=E4=BA=A4=E5=8F=89?= =?UTF-8?q?=E8=BD=B4=E5=B1=9E=E6=80=A7=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cjand <1747143535@qq.com> --- .../flutter/lib/src/material/page_transitions_theme.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/material/page_transitions_theme.dart b/packages/flutter/lib/src/material/page_transitions_theme.dart index f0ed130220..e07d0cd163 100644 --- a/packages/flutter/lib/src/material/page_transitions_theme.dart +++ b/packages/flutter/lib/src/material/page_transitions_theme.dart @@ -201,10 +201,7 @@ class _OpenRightwardsPageTransition extends StatelessWidget { return AnimatedBuilder( animation: animation, builder: (BuildContext context, Widget? child) { - return Container( - alignment: Alignment.topLeft, - child: child, - ); + return child ?? Container(); }, child: AnimatedBuilder( animation: secondaryAnimation, -- Gitee