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
32
33```bash
34# Display the help information.
35bm help
36```
37
38
39## install
40
41```bash
42bm install [-h] [-p filePath] [-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 an HAP with other HAPs in the specified path. This parameter is mandatory.|
52| -r | Installs an HAP in overwrite mode. This parameter is optional. By default, the HAP is installed in overwrite mode.|
53| -s |  Installs an HSP. Each directory can have only one HSP with the same bundle name. This parameter is mandatory only for the HSP installation.|
54| -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.|
55
56
57Example
58```bash
59# Install an HAP.
60bm install -p /data/app/ohos.app.hap
61# Install an HAP in overwrite mode.
62bm install -p /data/app/ohos.app.hap -r
63# Install an HSP.
64bm install -s xxx.hsp
65# Install a HAP and its dependent HSP.
66bm install -p aaa.hap -s xxx.hsp yyy.hsp
67# Install an HAP. The waiting time is 10s.
68bm install -p /data/app/ohos.app.hap -w 10
69```
70
71## uninstall
72
73```bash
74bm uninstall [-h] [-n bundleName] [-m moduleName] [-k] [-s] [-v versionCode]
75```
76
77  **Parameters of the uninstall command**
78
79| Parameter| Description|
80| -------- | -------- |
81| -h | Displays help information.|
82| -n | Uninstalls a bundle. This parameter is mandatory.|
83| -m | Uninstalls a module. This parameter is optional. By default, all modules are uninstalled.|
84| -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.|
85| -s |  Uninstalls an HSP. This parameter is mandatory only for the HSP installation.|
86| -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.|
87
88
89Example
90
91```bash
92# Uninstall a bundle.
93bm uninstall -n com.ohos.app
94# Uninstall a module of a bundle.
95bm uninstall -n com.ohos.app -m com.ohos.app.EntryAbility
96# Uninstall a shared bundle.
97bm uninstall -n com.ohos.example -s
98# Uninstall a shared bundle of the specified version.
99bm uninstall -n com.ohos.example -s -v 100001
100# Uninstall a bundle and retain user data.
101bm uninstall -n com.ohos.app -k
102```
103
104
105## dump
106
107```bash
108bm dump [-h] [-a] [-n bundleName] [-s shortcutInfo] [-d deviceId]
109```
110
111  **Parameters of the dump command**
112
113| Parameter| Description|
114| -------- | -------- |
115| -h | Displays help information.|
116| -a | Displays all bundles installed in the system. This parameter is optional.|
117| -n | Displays the details of a bundle. This parameter is optional.|
118| -s | Displays the shortcut information of a bundle. This parameter is optional.|
119| -d | Displays the bundle information on a given device, which is the current device by default. This parameter is optional.  |
120
121
122Example
123
124```bash
125# Display the names of all bundles installed in the system.
126bm dump -a
127# Display the details of a bundle.
128bm dump -n com.ohos.app
129# Display the shortcut information of a bundle.
130bm dump -s -n com.ohos.app
131# Display cross-device bundle information.
132bm dump -n com.ohos.app -d xxxxx
133```
134
135## clean
136
137```bash
138bm clean [-h] [-c] [-n bundleName] [-d] [-i appIndex]
139```
140**Parameters of the clean command**
141
142| Parameter| Description|
143| -------- | --------- |
144| -h | Displays help information.|
145| -c -n | **-n** is mandatory, and **-c** is optional. Clears the cache data of a specified bundle.|
146| -d -n | **-n** is mandatory, and **-d** is optional. Clears the data directory of a specified bundle.|
147| -i | Clears the data directory of an application clone. This parameter is optional. The default value is 0.|
148
149
150Example
151
152```bash
153# Clear the cache data of a bundle.
154bm clean -c -n com.ohos.app
155# Clear the user data of a bundle.
156bm clean -d -n com.ohos.app
157// Execution result
158clean bundle data files successfully.
159```
160
161<!--Del-->
162## enable
163
164```bash
165bm enable [-h] [-n bundleName] [-a abilityName]
166```
167
168
169  **Parameters of the enable command**
170
171| Parameter| Description|
172| -------- | -------- |
173| -h | Displays help information.|
174| -n | Enables a specified bundle. This parameter is mandatory.|
175| -a | Enables an ability with a specified bundle name. This parameter is optional.|
176
177
178Example
179
180```bash
181# Enable a bundle.
182bm enable -n com.ohos.app -a com.ohos.app.EntryAbility
183// Execution result
184enable bundle successfully.
185```
186
187
188## disable
189
190```bash
191bm disable [-h] [-n bundleName] [-a abilityName]
192```
193
194
195  **Parameters of the disable command**
196
197| Parameter| Description|
198| -------- | -------- |
199| -h | Displays help information.|
200| -n | Disables a specified bundle. This parameter is mandatory.|
201| -a | Disables an ability with a specified bundle name. This parameter is optional.|
202
203
204Example
205
206```bash
207# Disable a bundle.
208bm disable -n com.ohos.app -a com.ohos.app.EntryAbility
209// Execution result
210disable bundle successfully.
211```
212<!--DelEnd-->
213
214
215## get
216
217```bash
218bm get [-h] [-u]
219```
220
221  **Parameters of the get command**
222
223| Parameter| Description|
224| -------- | -------- |
225| -h |Displays help information.|
226| -u | Obtains the UDID of a device. This parameter is mandatory.|
227
228
229Example
230
231```bash
232# Obtain the UDID of a device.
233bm get -u
234// Execution result
235udid of current device is:
23623CADE0C
237```
238
239
240## quickfix
241
242```bash
243bm quickfix [-h] [-a -f filePath [-t targetPath] [-d]] [-q -b bundleName] [-r -b bundleName]
244```
245
246Note: For details about how to create an .hqf file, see [HQF Packing Command](packing-tool.md#hqf-packing-command).
247
248  **Parameters of the quickfix command**
249|   Parameter | Description|
250| -------- | -------- |
251| -h | Displays help information.|
252| -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.|
253| -q -b | **-q** is optional, and **-b** is mandatory when **-q** is specified. Displays the patch information based on the bundle name.|
254| -r&nbsp;-b | **-r** is optional, and **-b** is mandatory when **-r** is specified. Uninstalls a disabled patch based on the bundle name.|
255| -t | Fixes a bundle to a specified path. This parameter is optional.|
256| -d | Selects the debug mode for quick fix. This parameter is optional.|
257
258
259
260Example
261
262```bash
263# Display patch package information by the bundle name.
264bm quickfix -q -b com.ohos.app
265# Execution result
266# Information as follows:
267// ApplicationQuickFixInfo:
268//  bundle name: com.ohos.app
269//  bundle version code: xxx
270//  bundle version name: xxx
271//  patch version code: x
272//  patch version name:
273//  cpu abi:
274//  native library path:
275//  type:
276# Install a quick fix patch.
277bm quickfix -a -f /data/app/
278// Execution result
279apply quickfix succeed.
280# Uninstall a quick fix patch.
281bm quickfix -r -b com.ohos.app
282// Execution result
283delete quick fix successfully
284```
285
286## dump-shared
287
288```bash
289bm dump-shared [-h] [-a] [-n bundleName] [-m moduleName]
290```
291
292  **Parameters of the dump-shared command**
293
294| Parameter| Description|
295| -------- | -------- |
296| -h | Displays help information.|
297| -a | Displays all HSPs in the system. This parameter is optional.|
298| -n | Displays detailed information about the shared library with a specified bundle name. This parameter is optional.|
299| -m | Displays detailed information about the shared library with a specified bundle name and module name. This parameter is optional.|
300
301
302Example
303
304```bash
305# Display the bundle names of all shared libraries installed in the system.
306bm dump-shared -a
307# Display the details about the specified shared library.
308bm dump-shared -n com.ohos.lib
309# Display information about the shared library on which a specified module of a bundle depends.
310bm dump-dependencies -n com.ohos.app -m entry
311```
312
313## dump-dependencies
314
315Displays information about the shared library on which a specified module of a bundle depends.
316```bash
317bm dump-dependencies [-h] [-n bundleName] [-m moduleName]
318```
319
320**Parameters of the dump-dependencies command**
321| Parameter| Description|
322| -------- | -------- |
323| -h | Displays help information.|
324| -n | Displays details about a shared library. This parameter is mandatory.|
325| -m | Displays information about the shared library on which a specified module of a bundle depends. This parameter is optional.|
326
327Example
328```Bash
329# Display information about the shared library on which a specified module of a bundle depends.
330bm dump-dependencies -n com.ohos.app -m entry
331```
332
333
334## compile
335
336Executes the AOT compilation on a bundle.
337```bash
338bm compile [-h] [-m mode] [-r bundleName]
339```
340**Parameters of the compile command**
341
342| Parameter| Description|
343| -------- | -------- |
344| -h | Displays help information.|
345| -a | Compiles all bundles. This parameter is optional.|
346| -m |  Compiles a bundle based on the bundle name. The value can be **partial** or **full**. This parameter is optional.|
347| -r | Checks whether a bundle is removed. This parameter is optional.|
348
349Example
350
351```bash
352# Compile a bundle based on the bundle name.
353bm compile -m partial com.example.myapplication
354```
355
356## copy-ap
357
358Copies an .ap file to the **/data/local/pgo** directory of a specified bundle.
359
360```bash
361bm copy-ap [-h] [-a] [-n bundleName]
362```
363
364**Parameters of the copy-ap command**
365
366| Parameter| Description|
367| -------- | -------- |
368| -h | Displays help information.|
369| -a |  Copies the .ap files related to all bundles. By default, .ap files related to all bundles are copied. This parameter is optional.|
370| -n |  Copies the .ap file related to a specified bundle, which is the current bundle by default. This parameter is optional.|
371
372Example
373
374```bash
375# Copy the .ap file related to a specified bundle.
376bm copy-ap -n com.example.myapplication
377```
378
379## dump-overlay
380
381Displays **overlayModuleInfo** of an overlay bundle.
382```bash
383bm dump-overlay [-h] [-b bundleName] [-m moduleName] [-t targetModuleName]
384```
385
386**Parameters of the dump-overlay command**
387| Parameter| Description|
388| -------- | -------- |
389| -h | Displays help information.|
390| -b | Displays all **OverlayModuleInfo** about a specified bundle. This parameter is mandatory.|
391| -m | By default, the name of the main module of the current bundle is used. This parameter is optional. Displays **OverlayModuleInfo** about a specified bundle based on the bundle name and module name.|
392| -t | Displays **OverlayModuleInfo** based on a specified bundle name and target module name. This parameter is optional.|
393
394Example
395
396```bash
397# Display OverlayModuleInfo of an overlay bundle named com.ohos.app.
398bm dump-overlay -b com.ohos.app
399
400# Display OverlayModuleInfo of the overlay module named entry in an overlay bundle named com.ohos.app.
401bm dump-overlay -b com.ohos.app -m entry
402
403# Display OverlayModuleInfo of the overlay module named feature in an overlay bundle named com.ohos.app.
404bm dump-overlay -b com.ohos.app -m feature
405```
406
407## dump-target-overlay
408
409Displays **overlayModuleInfo** of all overlay bundles associated with a target bundle.
410
411```bash
412bm dump-target-overlay [-h] [-b bundleName] [-m moduleName]
413```
414
415**Parameters of the dump-target-overlay command**
416| Parameter| Description|
417| -------- | -------- |
418| -h | Displays help information.|
419| -b | Displays all **OverlayBundleInfo** about a specified bundle. This parameter is mandatory.|
420| -m | Displays **OverlayModuleInfo** 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.|
421
422Example
423
424```bash
425# Display OverlayBundleInfo of an overlay bundle named com.ohos.app.
426bm dump-target-overlay-b com.ohos.app
427
428# Display OverlayModuleInfo of the overlay module named entry in an overlay bundle named com.ohos.app.
429bm dump-target-overlay -b com.ohos.app -m entry
430```
431
432## Error Codes
433
434### 9568320 The Signature File Does Not Exist
435**Error Message**
436
437Failed to install bundle, no signature file.
438
439![Example](figures/en-us_image_0000001389116960.png)
440
441**Symptom**
442
443A user attempts to install an unsigned HAP file.
444
445**Possible Causes**
446
447The HAP file is not signed.
448
449**Solution**
450
4511. Use [automatic signing](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/ide-signing-V13#section18815157237) to sign the HAP file. after the device is connected.
4522. Manually sign the HAP file. For details, see [Signing Your App/Atomic Service Manually](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/ide-signing-V13#section297715173233).
453<br></br>
454
455### 9568347 The Local .so File Fails to Be Parsed
456**Error Message**
457
458Error: install parse native so failed.
459
460**Symptom**
461
462When you start debugging or running a C++ app/service, the error message "error: install parse native so failed" is displayed during HAP installation.
463
464**Possible Causes**
465
466The Application Binary Interface (ABI) supported by the device does not match that configured in the C++ project.
467
468**Solution**
469
4701. Connect the device to DevEco Studio.
4712. Open the command line tool and go to the **toolchains\{*Version*}** directory in the OpenHarmony SDK installation directory.
472    ```
473    To check the OpenHarmony SDK installation directory, choose **File** > **Settings** > **SDK**.
474    ```
4753. 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.
476    ```
477    hdc shell
478    param get const.product.cpu.abilist
479    ```
4804. 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-V13/ide-hvigor-compilation-options-customizing-sample-V13#section4322212200) file. The rules are as follows:
481    * If the list includes only **default**, run the following command to check whether the **lib64** folder exists:
482      ```
483      cd /system/
484      ls
485      ```
486      ![Example](figures/en-us_image_0000001609001262.png)
487      * If the **lib64** folder exists, add the arm64-v8a type to **abiFilters**.
488      * If the **lib64** folder does not exist, add armeabi, armeabi-v7a, or both types to **abiFilters**.
489    * 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.
490<br></br>
491
492
493### 9568344 The Configuration File Fails to Be Parsed
494**Error Message**
495
496Error: install parse profile prop check error.
497
498![Example](figures/en-us_image_0000001585361412.png)
499
500**Symptom**
501
502When 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.
503
504**Possible Causes**
505
506The 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.
507
508**Solution**
509
5101. Obtain the new signature fingerprint.
511
512    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-V13/ide-hvigor-compilation-options-customizing-sample-V13#section1448071082016) file.
513
514    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.
515
516    The format of the new .cer file is shown below. (The file content is an example.)
517
518    ![Example](figures/en-us_image_0000001585521364.png)
519
520
521
522    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:
523      ```
524      keytool -printcert -file xxx.cer
525      ```
526    d. Remove the colon (:) from the SHA-256 content in the certificate fingerprint. What you get is the signature fingerprint.
527
528    An example SHA-256 value is shown below.
529    ![Example](figures/en-us_image_0000001635921233.png)
530
531    The signature fingerprint obtained by removing the colon is 5753DDBC1A8EF88A62058A9FC4B6AFAFC1C5D8D1A1B86FB3532739B625F8F3DB.
532
5332. Obtain the **install_list_capability.json** file of the device.
534
535    a. Connect the device.
536
537    b. Run the following command to view the **install_list_capability.json** file of the device:
538    ```
539    find /system -name install_list_capability.json
540    ```
541    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.
542    ```
543    /system/etc/app/install_list_capability.json
544    ```
545    c. Run the following command to obtain the **install_list_capability.json** file:
546    ```
547    hdc shell mount -o rw,remount /
548    hdc file recv /system/etc/app/install_list_capability.json
549    ```
550
5513. 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.
552![Example](figures/en-us_image_0000001635641893.png)
5534. Push the modified **install_list_capability.json** file to the device and restart the device.
554
555    ```
556    hdc shell mount -o rw,remount /
557    hdc file send install_list_capability.json /system/etc/app/install_list_capability.json
558    hdc shell chmod 644 /system/etc/app/install_list_capability.json
559    hdc shell reboot
560    ```
5615. Reinstall the application.
562
563
564### 9568305 The Dependent Module Does Not Exist
565**Error Message**
566
567Error: dependent module does not exist.
568
569![Example](figures/en-us_image_0000001560338986.png)
570
571**Symptom**
572
573When you start debugging or run an application, the error message "error: dependent module does not exist" is displayed during the installation of the HAP.
574
575**Possible Causes**
576
577The SharedLibrary module on which the application depends is not installed.
578
579**Solution**
580
5811. 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.
582![Example](figures/en-us_image_0000001560201786.png)
5832. 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.
584![Example](figures/en-us_image_0000001610761941.png)
5853. Choose **Run** > **Edit Configurations**. On the **General** tab page, select **Auto Dependencies**. Click **OK** to save the configuration, and then run or debug the project.
586![Example](figures/en-us_image_9568305.png)
587
588### 9568259 Some Fields Are Missing in the Configuration File
589**Error Message**
590
591Error: install parse profile missing prop.
592
593![Example](figures/en-us_image_0000001559130596.png)
594
595**Symptom**
596
597When you start debugging or run an application, the error message "error: install parse profile missing prop" is displayed during the installation of the HAP.
598
599**Possible Causes**
600
601Mandatory fields are missing in the **app.json5** and **module.json5** files.
602
603**Solution**
604
605* 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).
606* 2. Determine the missing fields based on the HiLog.
607
608    Run the following command to enable disk flushing:
609    ```
610    hilog -w start
611    ```
612
613    Disk location: /data/log/hilog
614
615    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.
616
617
618### 9568258 The Release Types of the New Application and Existing Application Are Different
619**Error Message**
620
621Error: install releaseType target not same.
622
623![Example](figures/en-us_image_0000001609976041.png)
624
625**Symptom**
626
627When you start debugging or run an application, the error message "error: install releaseType target not same" is displayed during the installation of the HAP.
628
629**Possible Causes**
630
631* Scenario 1: The value of **releaseType** in the SDK used by the existing HAP is different from that used by the new HAP.
632* Scenario 2: When the application has multiple HAPs, the **releaseType** values in the SDK used by each HAP are different.
633
634**Solution**
635
636* Scenario 1: Uninstall the existing HAP on the device and then install a new HAP.
637* Scenario 2: Use the same SDK to repackage the HAPs to ensure that the **releaseType** values of multiple HAPs are the same.
638
639
640### 9568322 The Signature Verification Fails Because the Application Source Is Untrusted
641**Error Message**
642
643Error: signature verification failed due to not trusted app source.
644
645![Example](figures/en-us_image_0000001585042216.png)
646
647**Symptom**
648
649When 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.
650
651**Possible Causes**
652
653* Scenario 1: The signature does not contain the UDID of the debugging device.
654
655* 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.
656
657**Solution**
658
659* Scenario 1:
660	1. Use [automatic signing](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/ide-signing-V13#section18815157237) to sign the HAP file. after the device is connected.
661	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-->.
662		```
663		// Command for obtaining the UDID
664		hdc shell bm get -u
665		```
666* 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.
667
668
669### 9568289 The Installation Fails Because the Permission Request Fails
670**Error Message**
671
672Error: install failed due to grant request permissions failed.
673
674![Example](figures/en-us_image_0000001585201996.png)
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![Example](figures/en-us_image_0000001635521909.png)
695
696**Symptom**
697
698When 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.
699
700**Possible Causes**
701
702The SDK version used for build and packing does not match the device image version.
703
704**Solution**
705
706* 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:
707  ```
708  hdc shell param get const.ohos.apiversion
709  ```
710  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.
711
712* Scenario 2: For applications that need to run on OpenHarmony devices, ensure that runtimeOS has been changed to OpenHarmony.
713
714### 9568332 The Installation Fails Due to Inconsistent Signatures
715**Error Message**
716
717Error: install sign info inconsistent.
718
719![Example](figures/en-us_image_0000001635761329.png)
720
721**Symptom**
722
723When you start debugging or run an application, the error message "error: install sign info inconsistent" is displayed during the installation of the HAP.
724
725**Possible Causes**
726
7271. The 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.
7282. If an application is uninstalled but its data is kept, and a new application with the same bundle name is later installed, it is necessary to check whether the identity details match. If the signature information is inconsistent, this error is reported.
729
730
731**Solution**
732
7331. Uninstall the application, or deselect **Keep Application Data**. Then install the new application.
7342. 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.
7353. If an application is uninstalled but its data is kept, a new application with the same bundle name but different signature information fails to be installed. To install the new application, you must first reinstall the uninstalled application and uninstall it without retaining the data.
736
737### 9568329 The Signature Information Fails to Be Verified
738**Error Message**
739
740Error: verify signature failed.
741
742![Example](figures/en_image_155401.png)
743
744**Symptom**
745
746The **bundleName** in the signature information is different from that of the application.
747
748**Possible Causes**
749
750* 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.
751
752* Scenario 2: An incorrect signature file (with the file name extension .p7b) is used for signature, causing the bundle name inconsistency.
753
754
755**Solution**
756
757* 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.
758
759* Scenario 2: Check the signing process and signing certificate. For details, see [Signing Your App/Atomic Service](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V13/ide-signing-V13).
760
761
762### 9568266 The Installation Permission Is Denied
763**Error Message**
764
765Error: install permission denied.
766
767![Example](figures/en_image_9568266.png)
768
769**Symptom**
770
771When you run the **hdc install** command to install the HAP file, the error message "code:9568266 error: install permission denied" is displayed.
772
773**Possible Causes**
774
775The **hdc install** command cannot be used to install the enterprise application with a release signature.
776
777**Solution**
778
7791. Run the **hdc install** command to install and debug the enterprise application with a debug signature.
780
781
782### 9568337 The Installation Parsing Fails
783**Error Message**
784
785Error: install parse unexpected.
786
787**Symptom**
788
789When an application is pushed to a device, an error message is displayed, indicating that the HAP file fails to be opened.
790
791**Possible Causes**
792
793* 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.
794
795* Scenario 2: The HAP file is damaged when it is pushed to the device.
796
797**Solution**
798
799* 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.
800  ```bash
801  hdc shell df -h /system
802  ```
803
804* 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.
805
806
807### 9568316 The Permission of APL in ProxyData Is Low
808**Error Message**
809
810Error: apl of required permission in proxy data is too low.
811
812**Symptom**
813
814**requiredReadPermission** and **requiredWritePermission** of the **proxyData** tag in the **module.json** file fail to be verified.
815
816**Possible Causes**
817
818**requiredReadPermission** and **requiredWritePermission** can be configured only when the application has the permission level of **system_basic** or **system_core**.
819
820**Solution**
821
8221. Check whether the **proxyData** content defined by the application meets the requirements. For details, see [proxyData](../quick-start/module-configuration-file.md#proxydata).
823
824
825### 9568315 The URI in Proxy Data Is Incorrect
826**Error Message**
827
828Error: uri in proxy data is wrong.
829
830**Symptom**
831
832**uri** of the **proxyData** tag in the **module.json** file fails to be verified.
833
834**Possible Causes**
835
836The format of **uri** does not meet the requirement.
837
838**Solution**
839
8401. Check whether the **proxyData** content defined by the application meets the requirements. For details, see [proxyData](../quick-start/module-configuration-file.md#proxydata).
841
842
843### 9568336 The Debugging Type of the Application Is Different From That of the Installed Application
844**Error Message**
845
846Error: install debug type not same.
847
848**Symptom**
849
850The debugging type (the **debug** field in the **app.json** file) of the application is different from that of the installed application.
851
852**Possible Causes**
853
854You 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.
855
856**Solution**
857
8581. Uninstall the existing application and install the new application.
859
860
861### 9568296 The Bundle Type Is Incorrect
862**Error Message**
863
864Error: install failed due to error bundle type.
865
866**Symptom**
867
868The installation fails because the **bundleType** tag is incorrect.
869
870**Possible Causes**
871
872The **bundleType** of the application to be installed is different from that of an existing application with the same **bundleName**.
873
874**Solution**
875
876* Method 1. Uninstall the existing application and install the application again.
877
878* Method 2: Set the **bundleType** of the application to the same as that of the existing application.
879
880
881### 9568292 The User With UserID 0 Can Install Only the Singleton Application
882**Error Message**
883
884Error: install failed due to zero user can only install singleton app.
885
886**Symptom**
887
888The 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**.
889
890**Possible Causes**
891
892**UserID** is not set to **0** for the application with the **singleton** permission.
893
894**Solution**
895
8961. If the application has the **singleton** permission, set **UserID** to **0** during installation.
897	```
898	//Set the user ID to 0.
899	hdc install -p <HAP file name>.hap -u 0
900	```
901
902
903### 9568263 The Installation Version Cannot Be Downgraded
904**Error Message**
905
906Error: install version downgrade.
907
908**Symptom**
909
910The installation fails because **versionCode** of the application to be installed is earlier than that of the existing application.
911
912**Possible Causes**
913
914The **versionCode** of the application to be installed is earlier than that of the existing application.
915
916**Solution**
917
9181. Uninstall the existing application and install the new application.
919
920
921### 9568304 The Application Does Not Support the Current Device Type
922**Error Message**
923
924Error: device type is not supported.
925
926**Symptom**
927
928The installation fails because the application does not support the current device type.
929
930**Possible Causes**
931
932The application does not support the current device type.
933
934**Solution**
935
9361. 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.
937
938
939### 9568317 The Multi-Process Configuration of the Application Does Not Match the System Configuration
940**Error Message**
941
942Error: isolationMode does not match the system.
943
944**Symptom**
945
946The installation fails because **isolationMode** of the application is not supported by the system.
947
948**Possible Causes**
949
950* 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**.
951
952* 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**.
953
954**Solution**
955
9561. Set the value of **isolationMode** in the HAP configuration file based on the isolation mode of the device.
957	```
958	//Query the value of persist.bms.supportIsolationMode. If errNum is:106 is returned, persist.bms.supportIsolationMode is not configured.
959	hdc shell
960	param get persist.bms.supportIsolationMode
961	//Set persist.bms.supportIsolationMode.
962	hdc shell
963	param set persist.bms.supportIsolationMode [true|false]
964	```
965
966
967### 9568315 The URI Attribute of the Proxy Data Is Incorrect
968**Error Message**
969
970Error: uri in proxy data is wrong.
971
972**Symptom**
973
974**uri** of the **proxyData** tag in the **module.json** file fails to be verified.
975
976**Possible Causes**
977
978The format of **uri** does not meet the requirement.
979
980**Solution**
981
9821. Ensure that the URI meets the format requirements.
983	```
984	//URI format specifications.
985	The URI of a data proxy must be unique and must be in the format of datashareproxy://bundleName/xxx.
986	```
987
988
989### 9568310 The Compatibility Policies Are Different
990**Error Message**
991
992Error: compatible policy not same.
993
994**Symptom**
995
996The compatibility policy of the new bundle is different from that of the existing bundle.
997
998**Possible Causes**
999
10001. The shared library to be installed has the same bundle name as the existing bundle.
10012. The bundle to be installed has the same bundle name as the existing shared library.
1002
1003**Solution**
1004
10051. Uninstall the installed bundle or shared library, and install the new bundle.
1006
1007
1008### 9568391 The Bundle Manager Service Is Stopped
1009**Error Message**
1010
1011Error: bundle manager service is died.
1012
1013**Symptom**
1014
1015The bundle manager service is stopped.
1016
1017**Possible Causes**
1018
1019The system service restarts due to an unknown exception.
1020
1021**Solution**
1022
10231. Check whether the crash file exists in the **/data/log/faultlog/faultlogger/** directory.
1024
10252. Check whether the crash file contains **foundation**.
1026
10273. Reinstall the bundle for multiple times. If the error persists, check whether a crash file containing **foundation** is generated.
1028
10294. If the error still persists, export the crash file and log file and submit them to [online tickets](https://developer.huawei.com/consumer/en/support/feedback/#/) for help.
1030
1031
1032### 9568393 The Code Signature Fails to Be Verified
1033**Error Message**
1034
1035Error: verify code signature failed.
1036
1037**Symptom**
1038
1039The code signature fails to be verified.
1040
1041**Possible Causes**
1042
1043The bundle does not contain code signature information.
1044
1045**Solution**
1046
10471. Install the latest version of DevEco Studio and sign the code again.
1048
1049
1050### 9568257 The PKCS7 File Failed to Be Verified
1051**Error Message**
1052
1053Error: fail to verify pkcs7 file.
1054
1055**Symptom**
1056
1057The PKCS7 file failed to be verified.
1058
1059**Possible Causes**
1060<!--RP3-->
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.<!--RP3End-->
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![Example](figures/en_image_9868257_1.png)
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 bundle to be uninstalled is not installed.
1099
1100**Solution**
1101
11021. Check whether the bundle to be uninstalled has been installed.
1103
1104### 9568388 Bundle Uninstall Is Not Allowed by Enterprise Device Management
1105**Error Message**
1106
1107Error: Failed to uninstall the HAP because the uninstall is forbidden by enterprise device management.
1108
1109**Symptom**
1110
1111The enterprise device management does not allow the uninstall of this bundle.
1112
1113**Possible Causes**
1114
1115The bundle is set not to be uninstalled.
1116
1117**Solution**
1118
11191. The enterprise device management cancels the uninstallation control of the bundle.
1120
1121### 9568284 The Installation Version Is Not Compatible
1122**Error Message**
1123
1124Error: install version not compatible.
1125
1126**Symptom**
1127
1128The installation version is not compatible.
1129
1130**Possible Causes**
1131
1132The version of the installed HSP does not match that of the installed HAP.
1133When an HSP is installed, the following information is verified:
11341. bundleName
11352. Version
11363. Signature
1137
1138**Solution**
1139
11401. Uninstall the HAP whose version does not match and then install the HSP.
11412. Change the HSP version to be the same as that of the HAP and install the HSP again.
1142
1143### 9568287 The Number of Entry Modules in the Installation Package Is Invalid
1144**Error Message**
1145
1146Error: install invalid number of entry HAP.
1147
1148**Symptom**
1149
1150The number of entry modules in the installation package is invalid.
1151
1152**Possible Causes**
1153
1154There are multiple entry modules in the installation package. An application can have only one entry module but multiple feature modules.
1155
1156**Solution**
1157
11581. Retain one entry module and change the other entry modules to feature modules (by modifying the **type** field in **module.json5**).
1159
1160
1161### 9568281 The vendor Field of the Installation Package Is Inconsistent
1162**Error Message**
1163
1164Error: install vendor not same.
1165
1166**Symptom**
1167
1168The **vendor** field of the installation package is inconsistent.
1169
1170**Possible Causes**
1171
1172The **vendor** field of the application in the **app.json5** file is inconsistent.
1173
1174**Solution**
1175
11761. 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.
11772. If an integrated HSP is included, the **vendor** field of the integrated HSP must be the same as that of the HAP.
1178
1179
1180### 9568274 An Error Occurs During Service Installation
1181**Error Message**
1182
1183Error: install installd service error.
1184
1185**Symptom**
1186
1187An error occurs during service installation.
1188
1189**Possible Causes**
1190
1191An exception occurs during service installation.
1192
1193**Solution**
1194
11951. Clear the cache and restart the device.
1196
1197
1198### 9568314 The HSP Fails to Be Installed
1199**Error Message**
1200
1201Error: Failed to install the HSP because installing a shared bundle specified by hapFilePaths is not allowed.
1202
1203**Symptom**
1204
1205The HSP fails to be installed.
1206
1207**Possible Causes**
1208
1209The HSP is installed by running the **hdc app install ***** command.
1210
1211**Solution**
1212
12131. Run the **hdc install -s ***** command to install the HSP.
1214
1215
1216### 9568359 The SELinux Fails to be Installed and Set
1217**Error Message**
1218
1219Error: installd set selinux label failed.
1220
1221**Symptom**
1222
1223The SELinux fails to be installed and set.
1224
1225**Possible Causes**
1226
1227The **apl** field in the signature configuration file is incorrect. It can be **normal**, **system_basic**, and **system_core**.
1228
1229**Solution**
1230
12311. Check whether the **apl** field in the .p7b file is correct.
1232
1233    ![Example](figures/en_image_9568359.png)
1234
12352. If the **apl** field is incorrect, modify the **apl** field in the **UnsgnedReleasedProfileTemplate.json** file and sign the file again.
1236
1237    ![Example](figures/en_image_9568359_2.png)
1238
1239
1240### 9568403 The Encryption Check Fails During the Installation
1241**Error Message**
1242
1243Error: check encryption failed.
1244
1245**Symptom**
1246
1247The encryption check fails during the installation.
1248
1249**Possible Causes**
1250
1251The image version is too early or the **lib** directory of the HAP contain non-so files.
1252
1253**Solution**
1254
12551. Install a new image version.
12562. Delete non-so files in the **lib** directory of the HAP project and re-sign and package the files.
1257
1258### 9568417 Failed to Verify the Signature
1259**Error Message**
1260
1261Error: bundle cannot be installed because the appId is not same with preinstalled bundle.
1262
1263**Symptom**
1264
1265The signature verification fails.
1266
1267**Possible Causes**
1268
1269The signature of the installed bundle is different from that of the pre-installed bundle with the same bundle name.
1270
1271**Solution**
1272
12731. Check whether the application is configured with an uninstallation disposed rule. The entity that set the rule is responsible for canceling the rule.
1274