1# Bundle Manager 2 3Bundle Manager (bm) is a tool for installing, uninstalling, updating, and querying bundles. It provides basic capabilities for debugging application installation packages. 4 5## Environment Setup 6 7Before using this tool, you must obtain <!--Del-->[<!--DelEnd-->hdc<!--Del-->](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md)<!--DelEnd--> and run the hdc shell command. 8 9 10## bm Commands 11 12| Name| Description| 13| -------- | -------- | 14| help | Displays the commands supported by the bm tool.| 15| install | Installs a bundle.| 16| uninstall | Uninstalls a bundle.| 17| dump | Displays bundle information.| 18| clean | Clears the cache and data of a bundle. This command is available in the root version. It is also available in the user version with developer mode enabled. It is unavailable in other cases.| 19| <!--DelRow-->enable | Enables a bundle. A bundle can be used after being enabled. This command is available in the root version but not in the user version.| 20| <!--DelRow-->disable | Disables a bundle. A bundle cannot be used after being disabled. This command is available in the root version but not in the user version.| 21| get | Obtains the UDID of a device.| 22| quickfix | Performs patch-related operations, such as installing or querying a patch.| 23| compile | Executes the AOT compilation on a bundle.| 24| copy-ap | Copies the .ap file of a bundle to the **/data/local/pgo** directory for the shell user to read the file.| 25| dump-dependencies | Displays the information about the modules on which the bundle depends.| 26| dump-shared | Displays the HSP information of a bundle.| 27| dump-overlay | Displays **overlayModuleInfo** of an overlay bundle.| 28| dump-target-overlay | Displays **overlayModuleInfo** of all overlay bundles associated with a target bundle.| 29 30 31## help Command 32 33```bash 34# Display the help information. 35bm help 36``` 37 38 39## Installation Command 40 41```bash 42bm install [-h] [-p filePath] [-u userId] [-r] [-w waitingTime] [-s hspDirPath] 43``` 44 45 **Parameters of the install command** 46 47 48| Parameter| Description| 49| -------- | -------- | 50| -h | Displays help information.| 51| -p | Installs a HAP with other HAPs in the specified path. This parameter is mandatory.| 52| -u | Installs a HAP for a given user, which is the currently active user by default. This parameter is optional. | 53| -r | Installs a HAP in overwrite mode. This parameter is optional. By default, the HAP is installed in overwrite mode.| 54| -s | Installs an HSP. Each directory can have only one HSP with the same bundle name. This parameter is mandatory only for HSP installation.| 55| -w | Waits for a specified time before installing a HAP. The minimum waiting time is 5s, and the maximum waiting time is 600s. The default waiting time is 5s. This parameter is optional.| 56 57 58Example 59```bash 60# Install a HAP. 61bm install -p /data/app/ohos.app.hap 62# Install a HAP in overwrite mode. 63bm install -p /data/app/ohos.app.hap -r 64# Install an HSP. 65bm install -s xxx.hsp 66# Install a HAP and its dependent HSP. 67bm install -p aaa.hap -s xxx.hsp yyy.hsp 68# Install a HAP for a specified user. The waiting time is 10s. 69bm install -p /data/app/ohos.app.hap -u 100 -w 10 70``` 71 72## uninstall 73 74```bash 75bm uninstall [-h] [-n bundleName] [-m moduleName] [-u userId] [-k] [-s] [-v versionCode] 76``` 77 78 **Parameters of the uninstall command** 79 80| Parameter| Description| 81| -------- | -------- | 82| -h | Displays help information.| 83| -n | Uninstalls a bundle. This parameter is mandatory.| 84| -m | Uninstalls a module. This parameter is optional. By default, all modules are uninstalled.| 85| -u | Uninstalls a bundle for a given user, which is the currently active user by default. This parameter is optional. | 86| -k | Uninstalls a bundle with or without retaining the bundle data. This parameter is optional. By default, the bundle data is deleted along the uninstall.| 87| -s | Uninstalls an HSP. This parameter is mandatory only for the HSP installation.| 88| -v | Uninstalls an HSP of a given version number. This parameter is optional. By default, all shared bundles with the specified bundle name are uninstalled.| 89 90 91Example 92 93```bash 94# Uninstall a bundle. 95bm uninstall -n com.ohos.app 96# Uninstall a module of a bundle. 97bm uninstall -n com.ohos.app -m com.ohos.app.EntryAbility 98# Uninstall a shared bundle. 99bm uninstall -n com.ohos.example -s 100# Uninstall a shared bundle of the specified version. 101bm uninstall -n com.ohos.example -s -v 100001 102# Uninstall a bundle and retain user data. 103bm uninstall -n com.ohos.app -k 104# Uninstall a module of a bundle for a specified user. 105bm uninstall -n com.ohos.app -m com.ohos.app.EntryAbility -u 100 106``` 107 108 109## dump 110 111```bash 112bm dump [-h] [-a] [-n bundleName] [-s shortcutInfo] [-u userId] [-d deviceId] 113``` 114 115 **Parameters of the dump command** 116 117| Parameter| Description| 118| -------- | -------- | 119| -h | Displays help information.| 120| -a | Displays all bundles installed in the system. This parameter is optional.| 121| -n | Displays the details of a bundle. This parameter is optional.| 122| -s | Displays the shortcut information of a bundle. This parameter is optional.| 123| -d | Displays the bundle information on a given device, which is the current device by default. This parameter is optional. | 124| -u | Displays the bundle information for a given user. By default, the bundle information of all users is displayed. This parameter is optional. | 125 126 127Example 128 129```bash 130# Display the names of all bundles installed in the system. 131bm dump -a 132# Display the details of a bundle. 133bm dump -n com.ohos.app -u 100 134# Display the shortcut information of a bundle. 135bm dump -s -n com.ohos.app -u 100 136# Display cross-device bundle information. 137bm dump -n com.ohos.app -d xxxxx 138``` 139 140## clean 141 142```bash 143bm clean [-h] [-c] [-n bundleName] [-d] [-u userId] [-i appIndex] 144``` 145**Parameters of the clean command** 146 147| Parameter| Description| 148| -------- | --------- | 149| -h | Displays help information.| 150| -c -n | **-n** is mandatory, and **-c** is optional. Clears the cache data of a specified bundle.| 151| -d -n | **-n** is mandatory, and **-d** is optional. Clears the data directory of a specified bundle.| 152| -i | Clears the data directory of an application clone. This parameter is optional. The default value is 0.| 153| -u | Clears the cache data of a bundle for a specified user, which is the currently active user by default. This parameter is optional. | 154 155 156Example 157 158```bash 159# Clear the cache data of a bundle. 160bm clean -c -n com.ohos.app -u 100 161# Clear the user data of a bundle. 162bm clean -d -n com.ohos.app -u 100 163// The execution result is as follows: 164clean bundle data files successfully. 165``` 166 167<!--Del--> 168## enable 169 170```bash 171bm enable [-h] [-n bundleName] [-a abilityName] [-u userId] 172``` 173 174 175 **Parameters of the enable command** 176 177| Parameter| Description| 178| -------- | -------- | 179| -h | Displays help information.| 180| -n | Enables a specified bundle. This parameter is mandatory.| 181| -a | Enables an ability with a specified bundle name. This parameter is optional.| 182| -u | Enables a bundle for a specified user, which is the currently active user by default. This parameter is optional. | 183 184 185Example 186 187```bash 188# Enable a bundle. 189bm enable -n com.ohos.app -a com.ohos.app.EntryAbility -u 100 190// The execution result is as follows: 191enable bundle successfully. 192``` 193 194 195## disable 196 197```bash 198bm disable [-h] [-n bundleName] [-a abilityName] [-u userId] 199``` 200 201 202 **Parameters of the disable command** 203 204| Parameter| Description| 205| -------- | -------- | 206| -h | Displays help information.| 207| -n | Disables a specified bundle. This parameter is mandatory.| 208| -a | Disables an ability with a specified bundle name. This parameter is optional.| 209| -u | Disables a bundle for a specified user, which is the currently active user by default. This parameter is optional. | 210 211 212Example 213 214```bash 215# Disable a bundle. 216bm disable -n com.ohos.app -a com.ohos.app.EntryAbility -u 100 217// The execution result is as follows: 218disable bundle successfully. 219``` 220<!--DelEnd--> 221 222 223## get 224 225```bash 226bm get [-h] [-u] 227``` 228 229 **Parameters of the get command** 230 231| Parameter| Description| 232| -------- | -------- | 233| -h |Displays help information.| 234| -u |Obtains the UDID of a device. This parameter is mandatory.| 235 236 237Example 238 239```bash 240# Obtain the UDID of a device. 241bm get -u 242// The execution result is as follows: 243udid of current device is: 24423CADE0C 245``` 246 247 248## quickfix 249 250```bash 251bm quickfix [-h] [-a -f filePath [-t targetPath] [-d]] [-q -b bundleName] [-r -b bundleName] 252``` 253 254Note: For details about how to create an .hqf file, see [HQF Packing Command](packing-tool.md#hqf-packing-command). 255 256 **Parameters of the quickfix command** 257| Parameter | Description| 258| -------- | -------- | 259| -h | Displays help information.| 260| -a -f | **-a** is optional, and **-f** is mandatory when **-a** is specified. Executes the quick fix patch installation command. **file-path** corresponds to an .hqf file. You can pass in one or more .hqf files or the directory where the .hqf file is located.| 261| -q -b | **-q** is optional, and **-b** is mandatory when **-q** is specified. Displays the patch information based on the bundle name.| 262| -r -b | **-r** is optional, and **-b** is mandatory when **-r** is specified. Uninstalls a disabled patch based on the bundle name.| 263| -t | Restores a bundle to a specified path.| 264| -d | Selects the debug mode for quick fix. This parameter is optional.| 265 266 267 268Example 269 270```bash 271# Display patch package information by the bundle name. 272bm quickfix -q -b com.ohos.app 273// The execution result is as follows: 274// Information as follows: 275// ApplicationQuickFixInfo: 276// bundle name: com.ohos.app 277// bundle version code: xxx 278// bundle version name: xxx 279// patch version code: x 280// patch version name: 281// cpu abi: 282// native library path: 283// type: 284# Install a quick fix patch. 285bm quickfix -a -f /data/app/ 286// The execution result is as follows: 287apply quickfix succeed. 288# Uninstall a quick fix patch. 289bm quickfix -r -b com.ohos.app 290// The execution result is as follows: 291delete quick fix successfully 292``` 293 294## dump-shared 295 296```bash 297bm dump-shared [-h] [-a] [-n bundleName] [-m moduleName] 298``` 299 300 **Parameters of the dump-shared command** 301 302| Parameter| Description| 303| -------- | -------- | 304| -h | Displays help information.| 305| -a | Displays all shared libraries installed in the system. This parameter is optional.| 306| -n | Displays details about a shared library. This parameter is optional.| 307| -m | Displays details about the bundle name and module name of a specified shared library. This parameter is optional.| 308 309 310Example 311 312```bash 313# Display the bundle names of all shared libraries installed in the system. 314bm dump-shared -a 315# Display the details about the specified shared library. 316bm dump-shared -n com.ohos.lib 317# Display information about the shared library on which a specified module of a bundle depends. 318bm dump-dependencies -n com.ohos.app -m entry 319``` 320 321## dump-dependencies 322 323Displays information about the shared library on which a specified module of a bundle depends. 324```bash 325bm dump-dependencies [-h] [-n bundleName] [-m moduleName] 326``` 327 328 **Parameters of the dump-dependencies command** 329| Parameter| Description| 330| -------- | -------- | 331| -h | Displays help information.| 332| -n | Displays details about a shared library. This parameter is mandatory.| 333| -m | Displays information about the shared library on which a specified module of a bundle depends. This parameter is optional.| 334 335Example 336```Bash 337# Display information about the shared library on which a specified module of a bundle depends. 338bm dump-dependencies -n com.ohos.app -m entry 339``` 340 341 342## compile 343 344Executes the AOT compilation on a bundle. 345```bash 346bm compile [-h] [-m mode] [-r bundleName] 347``` 348 **Parameters of the compile command** 349 350| Parameter| Description| 351| -------- | -------- | 352| -h | Displays help information.| 353| -a | Compiles all bundles. This parameter is optional.| 354| -m | Compiles a bundle based on the bundle name. The value can be **partial** or **full**. This parameter is optional.| 355| -r | Checks whether a bundle is removed. This parameter is optional.| 356 357Example 358 359```bash 360# Compile a bundle based on the bundle name. 361bm compile -m partial com.example.myapplication 362``` 363 364## copy-ap 365 366Copies an .ap file to the **/data/local/pgo** directory of a specified bundle. 367 368```bash 369bm copy-ap [-h] [-a] [-n bundleName] 370``` 371 372**Parameters of the copy-ap command** 373 374| Parameter| Description| 375| -------- | -------- | 376| -h | Displays help information.| 377| -a | Copies the .ap files related to all bundles. By default, .ap files related to all bundles are copied. This parameter is optional.| 378| -n | Copies the .ap file related to a specified bundle, which is the current bundle by default. This parameter is optional.| 379 380Example 381 382```bash 383# Copy the .ap file related to a specified bundle. 384bm copy-ap -n com.example.myapplication 385``` 386 387## dump-overlay 388 389Displays **overlayModuleInfo** of an overlay bundle. 390```bash 391bm dump-overlay [-h] [-b bundleName] [-m moduleName] [-u userId] [-t targetModuleName] 392``` 393 394**Parameters of the dump-overlay command** 395| Parameter| Description| 396| -------- | -------- | 397| -h | Displays help information.| 398| -b | Displays all **OverlayModuleInfo** about a specified bundle. This parameter is mandatory.| 399| -m | Displays **OverlayModuleInfo** based on a specified bundle name and module name. By default, **OverlayModuleInfo** of the main module of the current bundle is displayed. This parameter is optional.| 400| -t | Displays **OverlayModuleInfo** based on a specified bundle name and target module name. This parameter is optional.| 401| -u | Displays **OverlayModuleInfo** based on a specified bundle name, target module name, and user name, which is the currently active user by default. This parameter is optional.| 402 403Example 404 405```bash 406# Display OverlayModuleInfo of an overlay bundle named com.ohos.app. 407bm dump-overlay -b com.ohos.app 408 409# Display OverlayModuleInfo of the overlay module named entry in an overlay bundle named com.ohos.app. 410bm dump-overlay -b com.ohos.app -m entry 411 412# Display OverlayModuleInfo of the overlay module named feature in an overlay bundle named com.ohos.app. 413bm dump-overlay -b com.ohos.app -m feature 414``` 415 416## dump-target-overlay 417 418Displays **overlayModuleInfo** of all overlay bundles associated with a target bundle. 419 420```bash 421bm dump-target-overlay [-h] [-b bundleName] [-m moduleName] [-u userId] 422``` 423 424**Parameters of the dump-target-overlay command** 425| Parameter| Description| 426| -------- | -------- | 427| -h | Displays help information.| 428| -b | Displays all **OverlayBundleInfo** about a specified bundle. This parameter is mandatory.| 429| -m | Displays **OverlayBundleInfo** based on a specified bundle name and module name. By default, **OverlayBundleInfo** of the main module of the current bundle is displayed. This parameter is optional.| 430| -u | Displays **OverlayBundleInfo** based on a specified bundle name, target module name, and user name, which is the currently active user by default. This parameter is optional.| 431 432Example 433 434```bash 435# Display OverlayBundleInfo of an overlay bundle named com.ohos.app. 436bm dump-target-overlay-b com.ohos.app 437 438# Display OverlayModuleInfo of the overlay module named entry in an overlay bundle named com.ohos.app. 439bm dump-target-overlay -b com.ohos.app -m entry 440``` 441 442## Error Codes 443 444### 9568320 The signature file does not exist 445**Error Message** 446 447Failed to install bundle, no signature file. 448 449 450**Symptom** 451 452A user attempts to install an unsigned HAP file. 453 454**Possible Causes** 455 456The HAP file is not signed. 457 458**Solution** 459 4601. Use [automatic signing](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-signing-V5#section18815157237) to sign the HAP file after the device is connected. 4612. Manually sign the HAP file. For details, see <!--RP1-->[Signing Your App/Service Manually](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-signing-V5#section297715173233)<!--RP1End-->. 462<br></br> 463 464### 9568347 The local .so file fails to be parsed 465**Error Message** 466 467Error: install parse native so failed. 468 469**Symptom** 470 471When you start debugging or running a C++ app/service, the error message "error: install parse native so failed" is displayed during HAP installation. 472 473**Possible Causes** 474 475The Application Binary Interface (ABI) supported by the device does not match that configured in the C++ project. 476 477**Solution** 478 4791. Connect the device to DevEco Studio. 4802. Open the command line tool and go to the **toolchains\{*Version*}** directory in the OpenHarmony SDK installation directory. 481 ``` 482 To check the OpenHarmony SDK installation directory, choose **File** > **Settings** > **SDK**. 483 ``` 4843. Run the following command to obtain the list of ABI types supported by the device, which include one or more of the following: default, armeabi-v7a, armeabi, arm64-v8a, x86, and x86_64. 485 ``` 486 hdc shell 487 param get const.product.cpu.abilist 488 ``` 4894. Based on the obtained list, modify the **abiFilters** settings in the [module-level build-profile.json5](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-hvigor-compilation-options-customizing-sample-V5#section4322212200) file. The rules are as follows: 490 * If the list includes only **default**, run the following command to check whether the **lib64** folder exists: 491 ``` 492 cd /system/ 493 ls 494 ``` 495  496 * If the **lib64** folder exists, add the arm64-v8a type to **abiFilters**. 497 * If the **lib64** folder does not exist, add armeabi, armeabi-v7a, or both types to **abiFilters**. 498 * If the list includes one or more of the following, add at least one of them to **abiFilters**: armeabi-v7a, armeabi, arm64-v8a, x86, and x86_64. 499<br></br> 500 501 502### 9568344 The configuration file fails to be parsed 503**Error Message** 504 505Error: install parse profile prop check error. 506 507 508**Symptom** 509 510When you start debugging or run an application, the error message "error: install parse profile prop check error" is displayed during the installation of the HAP. 511 512**Possible Causes** 513 514The application uses the privileges, but the new signature fingerprint is not added to the **install_list_capability.json** file of the device after the signature file of the application is changed. 515 516**Solution** 517 5181. Obtain the new signature fingerprint. 519 520 a. Obtain the storage path of the signature file, which is the value of **profile** in the **signingConfigs** field in the [project-level build-profile.json5](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-hvigor-compilation-options-customizing-sample-V5#section1448071082016) file. 521 522 b. Open the signature file (with the file name extension .p7b), search for **development-certificate** in the file, copy **-----BEGIN CERTIFICATE-----**, **-----END CERTIFICATE-----**, and the information between them to a new text file, delete the newline characters, and save the file as a new .cer file. 523 524 The format of the new .cer file is shown below. (The file content is an example.) 525 526  527 528 529 530 c. Use the keytool (available in the **jbr/bin** folder of the DevEco Studio installation directory) to obtain the SHA-256 value of the certificate fingerprint from the .cer file: 531 ``` 532 keytool -printcert -file xxx.cer 533 ``` 534 d. Remove the colon (:) from the SHA-256 content in the certificate fingerprint. What you get is the signature fingerprint. 535 536 An example SHA-256 value is shown below. 537  538 539 The signature fingerprint obtained by removing the colon is 5753DDBC1A8EF88A62058A9FC4B6AFAFC1C5D8D1A1B86FB3532739B625F8F3DB. 540 5412. Obtain the **install_list_capability.json** file of the device. 542 543 a. Connect the device. 544 545 b. Run the following command to view the **install_list_capability.json** file of the device: 546 ``` 547 find /system -name install_list_capability.json 548 ``` 549 The **install_list_capability.json** file of the device is stored in the following directory. Find the corresponding configuration file based on the bundle name. 550 ``` 551 /system/etc/app/install_list_capability.json 552 ``` 553 c. Run the following command to obtain the **install_list_capability.json** file: 554 ``` 555 hdc shell mount -o rw,remount / 556 hdc file recv /system/etc/app/install_list_capability.json 557 ``` 558 5593. Add the signature fingerprint obtained to **app_signature** in the **install_list_capability.json** file. Note that the signature fingerprint must be configured under the corresponding bundle name. 560 5614. Push the modified **install_list_capability.json** file to the device and restart the device. 562 563 ``` 564 hdc shell mount -o rw,remount / 565 hdc file send install_list_capability.json /system/etc/app/install_list_capability.json 566 hdc shell chmod 644 /system/etc/app/install_list_capability.json 567 hdc shell reboot 568 ``` 5695. Reinstall the application. 570 571 572### 9568305 The dependent module does not exist 573**Error Message** 574 575Error: dependent module does not exist. 576 577 578**Symptom** 579 580When you start debugging or run an application, the error message "error: dependent module does not exist" is displayed during the installation of the HAP. 581 582**Possible Causes** 583 584The SharedLibrary module on which the application depends is not installed. 585 586**Solution** 587 5881. Install the dependent SharedLibrary module. On the **Run/Debug Configurations** page of DevEco Studio, select **Keep Application Data** on the **General** tab page, and click **OK** to save the configuration. Then run or debug the application again. 589 5902. On the **Run/Debug Configurations** page of DevEco Studio, click the **Deploy Multi Hap** tab, select **Deploy Multi Hap Packages**, select the dependent module SharedLibrary, and click **OK** to save the configuration. Then run or debug the application again. 591 592 593 594### 9568259 Some fields are missing in the configuration file 595**Error Message** 596 597Error: install parse profile missing prop.<br> 598 599 600**Symptom** 601 602When you start debugging or run an application, the error message "error: install parse profile missing prop" is displayed during the installation of the HAP. 603 604**Possible Causes** 605 606Mandatory fields are missing in the **app.json5** and **module.json5** files. 607 608**Solution** 609 610* 1. Check and add mandatory fields by referring to the [app.json5 file](../quick-start/app-configuration-file.md) and [module.json5 file](../quick-start/module-configuration-file.md). 611* 2. Determine the missing fields based on the HiLog. 612 613 Run the following command to enable disk flushing: 614 ``` 615 hilog -w start 616 ``` 617 618 Disk location: /data/log/hilog 619 620 Open the log file and find **profile prop %{public}s is mission**. For example, **profile prop icon is mission** indicates that the **icon** field is missing. 621 622 623### 9568258 The release types of the new application and existing application are different 624**Error Message** 625 626Error: install releaseType target not same.<br> 627 628 629**Symptom** 630 631When you start debugging or run an application, the error message "error: install releaseType target not same" is displayed during the installation of the HAP. 632 633**Possible Causes** 634 635The value of **releaseType** in the SDK used by the existing HAP is different from that used by the new HAP. 636 637**Solution** 638 6391. Uninstall the existing HAP on the device, and then install the new HAP. 640 641 642### 9568322 The signature verification fails because the application source is untrusted 643**Error Message** 644 645Error: signature verification failed due to not trusted app source. 646 647 648**Symptom** 649 650When you start debugging or run an application, the error message "error: signature verification failed due to not trusted app source" is displayed during the installation of the HAP. 651 652**Possible Causes** 653 654* Scenario 1: The signature does not contain the UDID of the debugging device. 655 656* Scenario 2: The [release certificate and release profile](https://developer.huawei.com/consumer/en/doc/app/agc-help-releaseharmony-0000001933963166) is used during signature. However, an application signed by a release certificate cannot be debugged or run. 657 658**Solution** 659 660* Scenario 1: 661 1. Use [automatic signing](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-signing-V5#section18815157237) to sign the HAP file after the device is connected. 662 2. If manual signature is used, add the UDID of the device to the **UnsgnedDebugProfileTemplate.json** file. For details, see <!--RP2-->[hapsigner Guide](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/hapsigntool-guidelines.md)<!--RP2End-->. 663 ``` 664 // Command for obtaining the UDID 665 hdc shell bm get -u 666 ``` 667* Scenario 2: Use the [debug certificate and debug profile](https://developer.huawei.com/consumer/en/doc/app/agc-help-debug-app-0000001914423098) to re-sign the application. 668 669 670### 9568289 The installation fails because the permission request fails 671**Error Message** 672 673Error: install failed due to grant request permissions failed. 674 675 676**Symptom** 677 678When you start debugging or run an application, the error message "error: install failed due to grant request permissions failed" is displayed during the installation of the HAP. 679 680**Possible Causes** 681 682The application uses the default Ability Privilege Level (APL), which is normal, and requires the system_basic or system_core permission. 683 684**Solution** 685 6861. Change the APL in the **UnsgnedDebugProfileTemplate.json** file to **system_basic** or **system_core**, and sign and pack the application again. 687 688 689### 9568297 The installation fails because the SDK version of the device is too early 690**Error Message** 691 692Error: install failed due to older sdk version in the device. 693 694 695**Symptom** 696 697When you start debugging or run an application, the error message "error: install failed due to older sdk version in the device" is displayed during the installation of the HAP. 698 699**Possible Causes** 700 701The SDK version used for build and packing does not match the device image version. 702 703**Solution** 704 705* Scenario 1: The device image version is earlier than the SDK version for build and packing. Update the device image version. Run the following command to query the device image version: 706 ``` 707 hdc shell param get const.ohos.apiversion 708 ``` 709 If the API version provided by the image is 10 and the SDK version used for application build is also 10, the possible cause is that the image version is too early to be compatible with the SDK verification rules of the new version. In this case, update the image version to the latest version. 710 711* Scenario 2: For applications that need to run on OpenHarmony devices, ensure that runtimeOS has been changed to OpenHarmony. 712 713 714### 9568332 The installation fails due to inconsistent signatures 715**Error Message** 716 717Error: install sign info inconsistent. 718 719 720**Symptom** 721 722When you start debugging or run an application, the error message "error: install sign info inconsistent" is displayed during the installation of the HAP. 723 724**Possible Causes** 725 726The signatures of the existing application and new application are different, or the signatures of HAPs and HSPs are different. **Keep Application Data** is selected in **Edit Configurations** (the application installation is overwritten) and the application is re-signed. 727 728 729**Solution** 730zh-cn\application-dev\quick-start\integrated-hsp.md 7311. Uninstall the application, or deselect **Keep Application Data**. Then install the new application. 7322. If the signature inconsistency is caused by HSPs provided by different teams, use [integrated HSP](../quick-start/integrated-hsp.md). If there are multiple HAPs, ensure that their signatures are the same. 733 734### 9568329 The signature information fails to be verified 735**Error Message** 736 737Error: verify signature failed. 738 739 740 741**Symptom** 742 743The **bundleName** in the signature information is different from that of the application. 744 745**Possible Causes** 746 747* Scenario 1: An HSP module provided by a third party is imported, and the HSP is neither an [integrated HSP](../quick-start/integrated-hsp.md) nor an HSP with the same bundle name, causing the bundle name inconsistency. 748 749* Scenario 2: An incorrect signature file (with the file name extension .p7b) is used for signature, causing the bundle name inconsistency. 750 751 752**Solution** 753 754* Scenario 1: Use an HSP only for the application with the same bundle name; use an integrated HSP for applications with different bundle names. Ask the third party to provide an integrated HSP or an HSP with the same bundle name. 755 756* Scenario 2: Check the signing process and signing certificate. For details, see [Signing Your App/Service](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-signing-V5). 757 758 759### 9568266 The installation permission is denied 760**Error Message** 761 762Error: install permission denied. 763 764 765**Symptom** 766 767When you run the **hdc install** command to install the HAP file, the error message "code:9568266 error: install permission denied" is displayed. 768 769**Possible Causes** 770 771The **hdc install** command cannot be used to install the enterprise application with a release signature. 772 773**Solution** 774 7751. Run the **hdc install** command to install and debug the enterprise application with a debug signature. 776 777 778### 9568337 The installation parsing fails 779**Error Message** 780 781Error: install parse unexpected. 782 783**Symptom** 784 785When an application is pushed to a device, an error message is displayed, indicating that the HAP file fails to be opened. 786 787**Possible Causes** 788 789* Scenario 1: The storage space of the system partition is full. As a result, when you run the **hdc file send** command, files on the device are damaged due to insufficient storage space. 790 791* Scenario 2: The HAP file is damaged when it is pushed to the device. 792 793**Solution** 794 795* 1. Check the storage space allocated to the system partition. If the storage space is full, clear the storage space to install the HAP file. 796 ```bash 797 hdc shell df -h /system 798 ``` 799 800* 2. Check the MD5 values of the local HAP file and the HAP file pushed to the device. If they are different, the HAP is damaged during the push. In this case, push the file again. 801 802 803### 9568316 The permission of APL in proxyData is low 804**Error Message** 805 806Error: apl of required permission in proxy data is too low. 807 808**Symptom** 809 810**requiredReadPermission** and **requiredWritePermission** of the **proxyData** tag in the **module.json** file fail to be verified. 811 812**Possible Causes** 813 814**requiredReadPermission** and **requiredWritePermission** can be configured only when the application has the permission level of **system_basic** or **system_core**. 815 816**Solution** 817 8181. Check whether the **proxyData** content defined by the application meets the requirements. For details, see [proxyData](../quick-start/module-configuration-file.md#proxydata). 819 820 821### 9568315 The URI in proxy data is incorrect 822**Error Message** 823 824Error: uri in proxy data is wrong. 825 826**Symptom** 827 828**uri** of the **proxyData** tag in the **module.json** file fails to be verified. 829 830**Possible Causes** 831 832The format of **uri** does not meet the requirement. 833 834**Solution** 835 8361. Check whether the **proxyData** content defined by the application meets the requirements. For details, see [proxyData](../quick-start/module-configuration-file.md#proxydata). 837 838 839### 9568336 The debugging type of the application is different from that of the installed application 840**Error Message** 841 842Error: install debug type not same. 843 844**Symptom** 845 846The debugging type (the **debug** field in the **app.json** file) of the application is different from that of the installed application. 847 848**Possible Causes** 849 850You have installed the application using the **Debug** button of DevEco Studio, and then you install the HAP file of the application by running the **hdc install** command. 851 852**Solution** 853 8541. Uninstall the existing application and install the new application. 855 856 857### 9568296 The bundle type is incorrect 858**Error Message** 859 860Error: install failed due to error bundle type. 861 862**Symptom** 863 864The installation fails because the **bundleType** tag is incorrect. 865 866**Possible Causes** 867 868The **bundleType** of the application to be installed is different from that of an existing application with the same **bundleName**. 869 870**Solution** 871 872* Method 1. Uninstall the existing application and install the application again. 873 874* Method 2: Set the **bundleType** of the application to the same as that of the existing application. 875 876 877### 9568292 The user with UserID 0 can install only the singleton application 878**Error Message** 879 880Error: install failed due to zero user can only install singleton app. 881 882**Symptom** 883 884The user with **UserID 0** is only allowed to install the application with the **singleton** permission, and the application with the **singleton** permission is only allowed to be installed by the user with **UserID 0**. 885 886**Possible Causes** 887 888**UserID** is not set to **0** for the application with the **singleton** permission. 889 890**Solution** 891 8921. If the application has the **singleton** permission, set **UserID** to **0** during installation. 893 ``` 894 // Set the user ID to 0. 895 hdc install -p <HAP file name>.hap -u 0 896 ``` 897 898 899### 9568263 The installation version cannot be downgraded 900**Error Message** 901 902Error: install version downgrade. 903 904**Symptom** 905 906The installation fails because **versionCode** of the application to be installed is earlier than that of the existing application. 907 908**Possible Causes** 909 910The **versionCode** of the application to be installed is earlier than that of the existing application. 911 912**Solution** 913 9141. Uninstall the existing application and install the new application. 915 916 917### 9568304 The application does not support the current device type 918**Error Message** 919 920Error: device type is not supported. 921 922**Symptom** 923 924The installation fails because the application does not support the current device type. 925 926**Possible Causes** 927 928The application does not support the current device type. 929 930**Solution** 931 9321. To adapt to the current device, add the current device type to the value of **deviceTypes** of the application. The value of **deviceTypes** can be any of the following: phone, tablet, 2in1, tv, wearable, and car. 933 934 935### 9568317 The multi-process configuration of the application does not match the system configuration 936**Error Message** 937 938Error: isolationMode does not match the system. 939 940**Symptom** 941 942The installation fails because **isolationMode** of the application is not supported by the system. 943 944**Possible Causes** 945 946* 1. The device supports the isolation mode (the value of **persist.bms.supportIsolationMode** is **true**), whereas the value of **isolationMode** in the HAP is **nonisolationOnly**. 947 948* 2. The device does not support the isolation mode (the value of **persist.bms.supportIsolationMode** is **false**), whereas the value of **isolationMode** in the HAP is **isolationOnly**. 949 950**Solution** 951 9521. Set the value of **isolationMode** in the HAP configuration file based on the isolation mode of the device. 953 ``` 954 // Query the value of persist.bms.supportIsolationMode. If errNum is:106 is returned, persist.bms.supportIsolationMode is not configured. 955 hdc shell 956 param get persist.bms.supportIsolationMode 957 // Set persist.bms.supportIsolationMode. 958 hdc shell 959 param set persist.bms.supportIsolationMode [true|false] 960 ``` 961 962 963### 9568315 The URI attribute of the proxy data is incorrect 964**Error Message** 965 966Error: uri in proxy data is wrong. 967 968**Symptom** 969 970**uri** of the **proxyData** tag in the **module.json** file fails to be verified. 971 972**Possible Causes** 973 974The format of **uri** does not meet the requirements. 975 976**Solution** 977 9781. Ensure that the URI meets the format requirements. 979 ``` 980 // URI format specifications: 981 The URI of a data proxy must be unique and must be in the format of datashareproxy://bundleName/xxx. 982 ``` 983 984 985### 9568310 The compatibility policies are different 986**Error Message** 987 988Error: compatible policy not same. 989 990**Symptom** 991 992The compatibility policy of the new bundle is different from that of the existing bundle. 993 994**Possible Causes** 995 996A HAP with the same name has been installed on the device. 997 998**Solution** 999 10001. Uninstall the HAP with the same name and install the new HAP. 1001 1002 1003### 9568391 The bundle manager service is stopped 1004**Error Message** 1005 1006Error: bundle manager service is died. 1007 1008**Symptom** 1009 1010The bundle manager service is stopped. 1011 1012**Possible Causes** 1013 1014When you run the **bm install -p ***.hap** command to install a pre-installed application, the running application is killed, causing an exception (for example, the foundation process restarts). 1015 1016**Solution** 1017 10181. Install the pre-installed applications by referring to the OTA upgrade guide. 1019 1020 1021### 9568393 The code signature fails to be verified 1022**Error Message** 1023 1024Error: verify code signature failed. 1025 1026**Symptom** 1027 1028The code signature fails to be verified. 1029 1030**Possible Causes** 1031 1032* 1. The package does not contain code signature information. 1033 1034* 2. The signing certificate is incorrect. 1035 1036 1037**Solution** 1038 1039* 1. Use the signing tool SDK to check whether the package is signed. 1040 ``` 1041 // Verify the signature. 1042 java -jar SDK installation path (SDK in the DevEco Studio installation directory) \toolchains\lib\hap-sign-tool.jar verify-app -outCertChain out.cer -outProfile out.p7b -inFile package path\**.hap 1043 // 1. If "is can not find codesign block" is returned, the package is not signed. 1044 // 2. If "verify codesign success," is returned, the package is signed. 1045 ``` 1046 1047* Scenario 2: Check the signing process and signing certificate. For details, see [Signing Your App/Service](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-signing-V5). 1048 1049 1050### 9568257 A PKCS7 file failed to be verified 1051**Error Message** 1052 1053Error: fail to verify pkcs7 file. 1054 1055**Symptom** 1056 1057A PKCS7 file failed to be verified. 1058 1059**Possible Causes** 1060 1061The signature used by the application does not meet the signature requirements for the HarmonyOS application. Generally, the signature for OpenHarmony applications is used and should be replaced with the signature for HarmonyOS applications. 1062 1063**Solution** 1064 10651. Select **Support HarmonyOS** during the process of signing your application/service. After the HarmonyOS application is signed, debug or run the application again. 1066 1067 1068### 9568401 The bundle to debug can run only on devices in developer mode 1069**Error Message** 1070 1071Error: debug bundle can only be installed in developer mode. 1072 1073**Symptom** 1074 1075The bundle to debug can run only on devices in developer mode. 1076 1077**Possible Causes** 1078 1079Developer mode is not enabled on the device. 1080 1081**Solution** 1082 10831. Choose **Settings** > **System** and check whether **Developer options** is available. If not, go to **Settings** > **About** and touch the version number for seven consecutive times until the message "Enable developer mode?" is displayed. Touch **OK** and enter the PIN (if set). Then the device will automatically restart. 10842. Connect the device to the PC using a USB cable. Choose **Settings** > **System** > **Developer options** and enable USB debugging. In the displayed dialog box, touch **Allow**. 10853. Start debugging or run the application. 1086 1087### 9568386 The bundle cannot be found for uninstallation 1088**Error Message** 1089 1090Error: uninstall missing installed bundle. 1091 1092**Symptom** 1093 1094The bundle cannot be found for uninstallation. 1095 1096**Possible Causes** 1097 1098The application is not completely uninstalled, and residual resources exist. 1099 1100**Solution** 1101 11021. Delete all resources that are not uninstalled in **el1** and **el2**. 11032. Install the application again. 1104 1105 1106### 9568284 The installation version is not compatible 1107**Error Message** 1108 1109Error: install version not compatible. 1110 1111**Symptom** 1112 1113The installation version is not compatible. 1114 1115**Possible Causes** 1116 1117The version of the installed HSP does not match that of the installed HAP. 1118When an HSP is installed, the following information is verified: 11191. bundleName 11202. Version 11213. Signature 1122 1123**Solution** 1124 11251. Uninstall the HAP whose version does not match and then install the HSP. 11262. Change the HSP version to be the same as that of the HAP and install the HSP again. 1127 1128### 9568287 The number of entry modules in the installation package is invalid 1129**Error Message** 1130 1131Error: install invalid number of entry hap. 1132 1133**Symptom** 1134 1135The number of entry modules in the installation package is invalid. 1136 1137**Possible Causes** 1138 1139There are multiple entry modules in the installation package. An application can have only one entry module but multiple feature modules. 1140 1141**Solution** 1142 11431. Retain one entry module and change the other entry modules to feature modules (by modifying the **type** field in **module.json5**). 1144 1145 1146### 9568281 The **vendor** field of the installation package is inconsistent 1147**Error Message** 1148 1149Error: install vendor not same. 1150 1151**Symptom** 1152 1153The **vendor** field of the installation package is inconsistent. 1154 1155**Possible Causes** 1156 1157The **vendor** field of the application in the **app.json5** file is inconsistent. 1158 1159**Solution** 1160 11611. If only a HAP is involved, the **vendor** field of the HAP must be the same as that of the installed application. In this case, uninstall and reinstall the HAP. 11622. If an integrated HSP is included, the **vendor** field of the integrated HSP must be the same as that of the HAP. 1163 1164 1165### 9568279 The version name used for installation is inconsistent 1166**Error Message** 1167 1168Error: install version name not same. 1169 1170**Symptom** 1171 1172The version name used for installation is inconsistent. 1173 1174**Possible Causes** 1175 1176* Scenario 1: If only a HAP file is involved, the version of the application to install is inconsistent with the application for which the data is saved. 1177 1178* Scenario 2: If an HSP and a HAP are involved, the bundle name, version number, SDK version number, and release type of the HSP are different from those of the HAP. 1179 1180**Solution** 1181 1182* Scenario 1: Deselect **Keep Application Data** on the entry configuration page of DevEco Studio. 1183 1184 1185* Scenario 2: Ensure that the bundle name, version number, SDK version number, and release type of the HSP are the same as those of the HAP. 1186 1187 1188### 9568274 An error occurs during service installation 1189**Error Message** 1190 1191Error: install installd service error. 1192 1193**Symptom** 1194 1195An error occurs during service installation. 1196 1197**Possible Causes** 1198 1199An exception occurs during service installation. 1200 1201**Solution** 1202 12031. Clear the cache and restart the device. 1204 1205 1206### 9568314 An HSP fails to be installed 1207**Error Message** 1208 1209Error: Failed to install the HSP because installing a shared bundle specified by hapFilePaths is not allowed. 1210 1211**Symptom** 1212 1213An HSP fails to be installed. 1214 1215**Possible Causes** 1216 1217The HSP is installed by running the **hdc app install ***** command. 1218 1219**Solution** 1220 12211. Run the **hdc install -s ***** command to install the HSP. 1222 1223 1224### 9568359 The SELinux fails to be installed and set 1225**Error Message** 1226 1227Error: installd set selinux label failed. 1228 1229**Symptom** 1230 1231The SELinux fails to be installed and set. 1232 1233**Possible Causes** 1234 1235The **apl** field in the signature configuration file is incorrect. It can be **normal**, **system_basic**, and **system_core**. 1236 1237**Solution** 1238 12391. Check whether the **apl** field in the .p7b file is correct. 1240 12412. If the **apl** field is incorrect, modify the **apl** field in the **UnsgnedReleasedProfileTemplate.json** file and sign the file again. 1242 1243 1244 1245### 9568403 The encryption check fails during the installation 1246**Error Message** 1247 1248Error: check encryption failed. 1249 1250**Symptom** 1251 1252The encryption check fails during the installation. 1253 1254**Possible Causes** 1255 1256The image version is too early or the **lib** directory of the HAP contain non-so files. 1257 1258**Solution** 1259 12601. Install a new image version. 12612. Delete non-so files in the **lib** directory of the HAP project and re-sign and package the files. 1262