DEV Community

HarmonyOS
HarmonyOS

Posted on

Devco Studio does not have ASCF subcontracting issues

Read the original article:Devco Studio does not have ASCF subcontracting issues

Problem Description

Subcontracting rules are configured for the ASCF project. However, when you click RunEdit Configurations->Deploy Multi Hap->Module in the Devco Studio development tool, the subcontracting list is not displayed in the drop-down list box.

Background Knowledge

Package loading is to divide all pages and resources in a project into multiple separate package files based on configuration rules. The files are downloaded separately during running to accelerate page rendering. Subcontracting the ASCF meta-service can optimize the loading time of the ASCF meta-service for the first startup and better manage and decouple the functions of each module.

Solution

In the debug compilation of the ASCF project, subpackages are combined into the main package to improve the build performance. You need to disable this function by setting the disableSubpackages parameter.

Command line compilation:
Add the --disableSubpackages parameter to the compilation command. The following is a complete compilation command.

ascf compile -m --disableSubpackages .\path\to\atomicservice-project
Enter fullscreen mode Exit fullscreen mode

Devco Studio development tool compilation:
Find the hvigorfile.ts file in the project directory and set disableSubpackages to false. The complete code is as follows:

import { appTasks } from '@ohos/hvigor-ohos-plugin';
import { hvigor } from '@ohos/hvigor';
import ascfPlugin, { signByBuildModePlugin, modifyShareInfoPlugin } from '@atomicservice/ascf-toolkit-hvigor-plugin';

export default {
  system: appTasks, 
  plugins: [
    ascfPlugin({ disableSubpackages: false }),
    signByBuildModePlugin('default', 'release')
  ]
}
Enter fullscreen mode Exit fullscreen mode

Written by Ataberk Celiktas

Top comments (0)