From 169e77fc6929652acc5b8d0ebdfb9a01c5de2e8c Mon Sep 17 00:00:00 2001 From: Gloria Date: Fri, 18 Nov 2022 16:12:33 +0800 Subject: [PATCH] Update docs against 10524 Signed-off-by: wusongqing --- .../apis/js-apis-Bundle-distributedBundle.md | 18 +- .../apis/js-apis-bundle-remoteAbilityInfo.md | 4 +- .../apis/js-apis-bundleManager-elementName.md | 22 + ...js-apis-bundleManager-remoteAbilityInfo.md | 19 + .../apis/js-apis-distributedBundle.md | 503 ++++++++++++++++++ .../reference/errorcodes/errcode-bundle.md | 371 +++++++++++++ 6 files changed, 931 insertions(+), 6 deletions(-) create mode 100644 en/application-dev/reference/apis/js-apis-bundleManager-elementName.md create mode 100644 en/application-dev/reference/apis/js-apis-bundleManager-remoteAbilityInfo.md create mode 100644 en/application-dev/reference/apis/js-apis-distributedBundle.md create mode 100644 en/application-dev/reference/errorcodes/errcode-bundle.md diff --git a/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md b/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md index f321aca70e..8701a6b80d 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle-distributedBundle.md @@ -24,7 +24,9 @@ SystemCapability.BundleManager.DistributedBundleFramework For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels). -## distributedBundle.getRemoteAbilityInfo +## distributedBundle.getRemoteAbilityInfodeprecated + +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo](js-apis-distributedBundle.md) instead. getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback<RemoteAbilityInfo>): void; @@ -51,7 +53,9 @@ This is a system API and cannot be called by third-party applications. -## distributedBundle.getRemoteAbilityInfo +## distributedBundle.getRemoteAbilityInfodeprecated + +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo](js-apis-distributedBundle.md) instead. getRemoteAbilityInfo(elementName: ElementName): Promise<RemoteAbilityInfo> @@ -81,7 +85,9 @@ This is a system API and cannot be called by third-party applications. | ------------------------------------------------------------ | --------------------------------- | | Promise\<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)> | Promise used to return the remote ability information.| -## distributedBundle.getRemoteAbilityInfos +## distributedBundle.getRemoteAbilityInfosdeprecated + +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo](js-apis-distributedBundle.md) instead. getRemoteAbilityInfos(elementNames: Array<ElementName>, callback: AsyncCallback<Array<RemoteAbilityInfo>>): void; @@ -104,11 +110,13 @@ This is a system API and cannot be called by third-party applications. | Name | Type | Mandatory| Description | | ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- | | elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)> | Yes | **ElementName** array, whose maximum length is 10. | -| callback | AsyncCallback< Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)>> | Yes | Callback used to return an array of the remote ability information.| +| callback | AsyncCallback< Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)>> | Yes | Callback used to return the remote ability information.| + +## distributedBundle.getRemoteAbilityInfosdeprecated -## distributedBundle.getRemoteAbilityInfos +> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo](js-apis-distributedBundle.md) instead. getRemoteAbilityInfos(elementNames: Array<ElementName>): Promise<Array<RemoteAbilityInfo>> diff --git a/en/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md index f44ea5c33a..ffde8d4356 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md @@ -6,7 +6,9 @@ The **RemoteAbilityInfo** module provides information about a remote ability. > > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. -## RemoteAbilityInfo +## RemoteAbilityInfo(deprecated) + +> This API is deprecated since API version 9. You are advised to use [RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md) instead. **System capability**: SystemCapability.BundleManager.DistributedBundleFramework diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-elementName.md b/en/application-dev/reference/apis/js-apis-bundleManager-elementName.md new file mode 100644 index 0000000000..93b932d3c4 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundleManager-elementName.md @@ -0,0 +1,22 @@ +# ElementName + +The **ElementName** module provides the element name information, which can be obtained through [Context.getElementName](js-apis-Context.md). + + +> **NOTE** +> +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. + +## ElementName + +**System capability**: SystemCapability.BundleManager.BundleFramework.Core + +| Name | Type | Readable| Writable| Description | +| ----------------------- | ---------| ---- | ---- | ------------------------- | +| deviceId | string | Yes | Yes | Device ID. | +| bundleName | string | Yes | Yes | Bundle name of the application. | +| abilityName | string | Yes | Yes | Name of the ability. | +| uri | string | Yes | Yes | Resource ID. | +| shortName | string | Yes | Yes | Short name of the ability. | +| moduleName | string | Yes | Yes | Module name of the HAP file to which the ability belongs. | + diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-remoteAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-remoteAbilityInfo.md new file mode 100644 index 0000000000..0281e4fc77 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundleManager-remoteAbilityInfo.md @@ -0,0 +1,19 @@ +# RemoteAbilityInfo + +The **RemoteAbilityInfo** module provides information about a remote ability, which can be obtained through [distributedBundle.getRemoteAbilityInfo](js-apis-distributedBundle.md). + +> **NOTE** +> +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. + +## RemoteAbilityInfo + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**System API**: This is a system API. + +| Name | Type | Readable| Writable| Description | +| ----------- | -------------------------------------------- | ---- | ---- | ----------------------- | +| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | No | Element name information of the remote ability. | +| label | string | Yes | No | Label of the remote ability. | +| icon | string | Yes | No | Icon of the remote ability.| diff --git a/en/application-dev/reference/apis/js-apis-distributedBundle.md b/en/application-dev/reference/apis/js-apis-distributedBundle.md new file mode 100644 index 0000000000..4df752e4c6 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-distributedBundle.md @@ -0,0 +1,503 @@ +# distributedBundle + +The **distributedBundle** module provides APIs for managing distributed bundles. + +> **NOTE** +> +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. + +The APIs provided by this module are system APIs. + +## Modules to Import + +``` +import distributedBundle from '@ohos.bundle.distributedBundle'; +``` + +## System Capability + +SystemCapability.BundleManager.DistributedBundleFramework + +## Required Permissions + +| Permission | Permission Level | Description | +| ------------------------------------------ | ------------ | ------------------ | +| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to query information about all applications.| + +For details, see "Permission Levels" in [Access Control Overview](../../security/accesstoken-overview.md). + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback\): void; + +Obtains information about the remote ability that matches the given element name. This API uses an asynchronous callback to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ----------- | ------------------------------------------------------------ | ---- | -------------------------------------------------- | +| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name. | +| callback | AsyncCallback<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the **RemoteAbilityInfo** object obtained. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + { + deviceId: '1', + bundleName: 'com.example.application', + abilityName: 'MainAbility' + }, (err, data) => { + if (err) { + console.error('Operation failed:' + JSON.stringify(err)); + } else { + console.info('Operation succeed:' + JSON.stringify(data)); + } + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementName: ElementName): Promise\; + +Obtains information about the remote ability that matches the given element name. This API uses a promise to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ----------- | -------------------------------------------- | ---- | ----------------------- | +| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name.| + +**Return value** + +| Type | Description | +| ------------------------------------------------------------ | --------------------------------- | +| Promise\<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Promise used to return the **RemoteAbilityInfo** object obtained.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + { + deviceId: '1', + bundleName: 'com.example.application', + abilityName: 'MainAbility' + }).then(data => { + console.info('Operation succeed:' + JSON.stringify(data)); + }).catch(err => { + console.error('Operation failed:' + JSON.stringify(err)); + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementNames: Array\, callback: AsyncCallback\>): void; + +Obtains information about remote abilities that match the given element names. This API uses an asynchronous callback to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- | +| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10. | +| callback | AsyncCallback\> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of **RemoteAbilityInfo** objects obtained. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + [ + { + deviceId: '1', + bundleName: 'com.example.application1', + abilityName: 'MainAbility1' + }, + { + deviceId: '1', + bundleName: 'com.example.application2', + abilityName: 'MainAbility' + } + ], (err, data) => { + if (err) { + console.error('Operation failed:' + JSON.stringify(err)); + } else { + console.info('Operation succeed:' + JSON.stringify(data)); + } + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementNames: Array\): Promise\>; + +Obtains information about remote abilities that match the given element names. This API uses a promise to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------ | --------------------------------------------------- | ---- | ----------------------- | +| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10.| + +**Return value** + +| Type | Description | +| ------------------------------------------------------------ | --------------------------------- | +| Promise\> | Promise used to return the array of **RemoteAbilityInfo** objects obtained.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + [ + { + deviceId: '1', + bundleName: 'com.example.application', + abilityName: 'MainAbility' + }, + { + deviceId: '1', + bundleName: 'com.example.application2', + abilityName: 'MainAbility' + } + ]).then(data => { + console.info('Operation succeed:' + JSON.stringify(data)); + }).catch(err => { + console.error('Operation failed:' + JSON.stringify(err)); + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementName: ElementName, locale: string, callback: AsyncCallback\): void; + +Obtains information about the remote ability that matches the given element name and locale. This API uses an asynchronous callback to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ----------- | ------------------------------------------------------------ | ---- | -------------------------------------------------- | +| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name. | +| locale | string |Yes| Target locale.| +| callback | AsyncCallback<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the **RemoteAbilityInfo** object obtained. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + { + deviceId: '1', + bundleName: 'com.example.application', + abilityName: 'MainAbility' + }, 'zh-Hans-CN', (err, data) => { + if (err) { + console.error('Operation failed:' + JSON.stringify(err)); + } else { + console.info('Operation succeed:' + JSON.stringify(data)); + } + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise\; + +Obtains information about the remote ability that matches the given element name and locale. This API uses a promise to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ----------- | -------------------------------------------- | ---- | ----------------------- | +| elementName | [ElementName](js-apis-bundleManager-elementName.md) | Yes | Target element name.| +| locale | string |Yes| Target locale.| + +**Return value** + +| Type | Description | +| ------------------------------------------------------------ | --------------------------------- | +| Promise\<[RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md)> | Promise used to return the **RemoteAbilityInfo** object obtained.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + { + deviceId: '1', + bundleName: 'com.example.application', + abilityName: 'MainAbility' + }, 'zh-Hans-CN').then(data => { + console.info('Operation succeed:' + JSON.stringify(data)); + }).catch(err => { + console.error('Operation failed:' + JSON.stringify(err)); + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementNames: Array\, locale: string, callback: AsyncCallback\>): void; + +Obtains information about remote abilities that match the given element names and locales. This API uses an asynchronous callback to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- | +| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10. | +| locale | string |Yes| Target locale.| +| callback | AsyncCallback\> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the array of **RemoteAbilityInfo** objects obtained. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + [ + { + deviceId: '1', + bundleName: 'com.example.application1', + abilityName: 'MainAbility1' + }, + { + deviceId: '1', + bundleName: 'com.example.application2', + abilityName: 'MainAbility' + } + ], 'zh-Hans-CN', (err, data) => { + if (err) { + console.error('Operation failed:' + JSON.stringify(err)); + } else { + console.info('Operation succeed:' + JSON.stringify(data)); + } + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` + +## distributedBundle.getRemoteAbilityInfo + +getRemoteAbilityInfo(elementNames: Array\, locale: string): Promise\>; + +Obtains information about remote abilities that match the given element names and locales. This API uses a promise to return the result. + +**System API**: This is a system API. + +**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + +**System capability**: SystemCapability.BundleManager.DistributedBundleFramework + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------ | --------------------------------------------------- | ---- | ----------------------- | +| elementNames | Array<[ElementName](js-apis-bundleManager-elementName.md)> | Yes | **ElementName** array, whose maximum length is 10.| +| locale | string |Yes| Target locale.| + +**Return value** + +| Type | Description | +| ------------------------------------------------------------ | --------------------------------- | +| Promise\> | Promise used to return the array of **RemoteAbilityInfo** objects obtained.| + +**Error codes** + +For details about the error codes, see [Bundle Error Codes](../errorcodes/errcode-bundle.md). + +| ID | Error Message | +|---------------|-------------------------| +| 201 | Permission denied.| +| 401 | The parameter check failed. | +| 801 | Capability not supported. | +| 17700001 | The specified bundle name is not found | +| 17700003 | The specified ability name is not found. | +| 17700007 | The specified device id is not found. | +| 17700027 | The distributed service is not running. | + +**Example** + +```js +try { + distributedBundle.getRemoteAbilityInfo( + [ + { + deviceId: '1', + bundleName: 'com.example.application', + abilityName: 'MainAbility' + }, + { + deviceId: '1', + bundleName: 'com.example.application2', + abilityName: 'MainAbility' + } + ], 'zh-Hans-CN').then(data => { + console.info('Operation succeed:' + JSON.stringify(data)); + }).catch(err => { + console.error('Operation failed:' + JSON.stringify(err)); + }); +} catch (err) { + console.error('Operation failed:' + JSON.stringify(err)); +} +``` diff --git a/en/application-dev/reference/errorcodes/errcode-bundle.md b/en/application-dev/reference/errorcodes/errcode-bundle.md new file mode 100644 index 0000000000..a7a0b45213 --- /dev/null +++ b/en/application-dev/reference/errorcodes/errcode-bundle.md @@ -0,0 +1,371 @@ +# Bundle Error Codes + +## 17700001 Nonexistent Bundle Name + +**Error Message** +The specified bundle name is not found. + +**Description** +This error code is reported when the bundle name passed in the API does not exist. + +**Possible Causes** +1. The bundle name is misspelled. +2. The corresponding application is not installed. + +**Solution** +1. Check whether the spelling of the bundle name is correct. +2. Check whether the corresponding application is installed. + +## 17700002 Nonexistent Module Name + +**Error Message** +The specified module name is not found. + +**Description** +This error code is reported when the module name passed in the API does not exist. + +**Possible Causes** +1. The module name is misspelled. +2. The module is not installed for the application. + +**Solution** +1. Check whether the spelling of the module name is correct. +2. Check whether the module is installed for the application. + +## 17700003 Nonexistent Ability Name + +**Error Message** +The specified ability name is not found. + +**Description** +This error code is reported when the ability name passed in the API does not exist. + +**Possible Causes** +1. The ability name is misspelled. +2. The corresponding application is not installed. + +**Solution** +1. Check whether the spelling of the ability name is correct. +2. Check whether the ability is installed for the application. + +## 17700004 Nonexistent User ID + +**Error Message** +The specified user id is not found. + +**Description** +This error code is reported when the user ID passed in the API does not exist. + +**Possible Causes** +The user ID is incorrect. The user does not exist. + +**Solution** +1. Check whether the user ID is correct. +2. Check whether the user exists. + +## 17700005 Nonexistent Application ID + +**Error Message** +The specified appId is not found. + +**Description** +This error code is reported when the value of **appId** passed in the API is an empty string. + +**Possible Causes** +**appId** is an empty string. + +**Solution** +Check whether **appId** is an empty string. + +## 17700006 Nonexistent Permission + +**Error Message** +The specified permission is not found. + +**Description** +This error code is reported when the permission passed in the API does not exist. + +**Possible Causes** +1. The permission name is misspelled. +2. The permission does not exist. + +**Solution** +1. Check whether the spelling of the permission name is correct. +2. Check whether the permission exists. + +## 17700007 Incorrect Device ID + +**Error Message** +The specified deviceId is not found. + +**Description** +This error code is reported when the device ID passed in the API is incorrect. + +**Possible Causes** +1. The device ID is incorrect. +2. The device ID does not exist. + +**Solution** +1. Check whether the device ID is correct. +2. Check whether the device ID exists. + +## 17700010 Application Installation Failure Due to File Parsing Failure + +**Error Message** +Failed to install the hap since the hap fails to be parsed. + +**Description** +This error code is reported when the application fails to be installed because the HAP fails to be parsed. + +**Possible Causes** +1. The HAP is not in ZIP format. +2. The configuration file in the HAP is not in JSON format. +3. Necessary fields are missing in the configuration file. + +**Solution** +1. Check whether the HAP is in ZIP format. +2. Check whether the configuration file is in [JSON format](../../quick-start/stage-structure.md). +3. Check whether an error message is displayed when DevEco Studio compiles the HAP. If necessary fields are missing, an error message will be displayed. + +## 17700011 Application Installation Failure Due to Signature Verification Failure + +**Error Message** +Failed to install the hap since the hap signature fails to be verified. + +**Description** +This error code is reported when the application fails to be installed due to signature verification failure. + +**Possible Causes** + +1. The HAP is not signed. +2. The source of the HAP signature information is unreliable. +3. The signature information of the HAP used for an upgrade is different from that of the installed HAP. +4. The signature information of multiple HAPs is inconsistent. + +**Solution** +1. Check whether the HAP is signed. +2. Check whether the same certificate is used for signing multiple HAPs. +3. Check whether the certificate used for signing the upgrade HAP is the same as the certificate used for signing the installed HAP. + +## 17700012 Application Installation Failure Due to Invalid File Path or Too Large File + +**Error Message** +Failed to install the hap since the path of the hap is invalid or too large size. + +**Description** +This error code is reported when the application fails to be installed because the HAP path is invalid or the HAP is too large. + +**Possible Causes** +1. The path of the HAP does not exist. +2. The path of the HAP is inaccessible. +3. The size of the HAP exceeds the upper limit 4 GB. + +**Solution** +1. Check whether the HAP path exists. +2. Check whether the HAP is read only or executable. +3. Check whether the size of the HAP exceeds 4 GB. + +## 17700015 Application Installation Failure Due to Different Configuration Information of Multiple HAP Packages + +**Error Message** +Failed to install haps since the configuration information of multi haps is inconsistent. + +**Description** +This error code is reported when the application fails to be installed because the HAPs have different configuration information. + +**Possible Causes** +The fields under **app** in the configuration files of these HAPs are inconsistent. + +**Solution** +Check whether the fields under **app** are the same. + +## 17700016 Application Installation Failure Due to Insufficient System Disk Space + +**Error Message** +Failed to install the hap since the system disk space is insufficient. + +**Description** +This error code is reported when the application fails to be installed due to insufficient system disk space. + +**Possible Causes** +The system disk space is insufficient. + +**Solution** +Check whether the system has sufficient disk space. + +## 17700017 Application Installation Failure Because the Version to Install is Too Earlier + +**Error Message** +Failed to install the hap since the version of the newly installed hap is too early. + +**Description** +This error code is reported when the version number of the application to install is earlier than the version in use. + +**Possible Causes** +The version number is earlier than the version in use. + +**Solution** +Ensure that the version of the application to install is later than the version in use. + +## 17700020 Failure to Uninstall Preinstalled Applications + +**Error Message** +The preinstalled app cannot be uninstalled. + +**Description** +This error code is reported when you attempt to uninstall a preinstalled application. + +**Possible Causes** +1. You might want to uninstall a non-preinstalled application but passed the bundle name of a preinstalled app. +2. The preinstalled application cannot be uninstalled. + +**Solution** +1. Check whether the bundle name is correct. +1. Check whether the preinstalled application can be uninstalled. + +## 17700021 Invalid UID + +**Error Message** +The specified uid is invalid. + +**Description** +This error code is reported when the UID passed in the API is invalid. + +**Possible Causes** +1. The UID is misspelled. +2. The UID does not exist. + +**Solution** +1. Check whether the UID is correct. +2. Check whether the UID exists. + +## 17700022 Invalid Source File + +**Error Message** +The input source file is invalid. + +**Description** +This error code is reported when the source file to be parsed is invalid. + +**Possible Causes** +1. The source file to be parsed does not exist. +2. The source file to be parsed is not in ZIP format. + +**Solution** +1. Check whether the source file to be parsed exists. +2. Check whether the source file to be parsed is in ZIP format. + +## 17700023 Nonexistent Default Application + +**Error Message** +The specified default app does not exist. + +**Description** +This error code is reported when the specified default application does not exist. + +**Possible Causes** +No default application is set for the device. + +**Solution** +Check whether the default application is set on the device. + +## 17700024 Nonexistent Configuration File + +**Error Message** +Failed to get profile since no profile in the hap. + +**Description** +This error code is reported when you attempt to obtain the configuration file that does not exist. + +**Possible Causes** +1. The metadata name passed in the API does not exist in the configuration file. +2. The content of the configuration file is not in JSON format. + +**Solution** +1. Check whether the metadata name in the **ability** or **extensionAbility** to be queried exists. +2. Check whether the content of the profile to be queried is in JSON format. + +## 17700025 Invalid Type + +**Error Message** +The specified type is invalid. + +**Description** +The type is invalid. + +**Possible Causes** +1. The type passed in the API is misspelled. +2. The type passed in the API does not exist. + +**Solution** +Check whether the spelling of type is correct. + +## 17700026 Application Disabled + +**Error Message** +The specified bundle is disabled. + +**Description** +This error code is reported when the specified application is disabled. + +**Possible Causes** +The application on the device has been disabled and cannot be queried. + +**Solution** +Check whether the application on the device is disabled. + +## 17700027 Distributed Service Not Started + +**Error Message** +The distributed service is not running. + +**Description** +This error code is reported when the distributed service is not started. + +**Possible Causes** +The device is not networked. + +**Solution** +Check whether the device is networked. +## 17700028 Mismatch Between Ability and Type + +**Error Message** +The ability does not match the type. + +**Description** +This error code is reported when the ability and type passed in the API do not match. + +**Possible Causes** +The ability and type are misspelled. + +**Solution** +Check whether the spellings of ability and type are correct. + +## 17700029 Disabled Ability + +**Error Message** +The specified ability is disabled. + +**Description** +This error code is reported when the specified ability is disabled. + +**Possible Causes** +The specified ability is disabled. + +**Solution** +Check whether the ability is disabled. You can run the [bm commands](../../../readme/bundle-management.md#bm-commands) to query the application information. + +## 17700030 Failure in Clearing Cache Files + +**Error Message** +The specified bundle does not support clearing cache files. + +**Description** +This error code is reported when the application does not support cache file clearing. + +**Possible Causes** +The application is a system application and the **AllowAppDataNotCleared** field is configured in the signing certificate. + +**Solution** +1. Check whether the application is a system application. You can run the [bm commands](../../../readme/bundle-management.md#bm-commands) to query the application information and check whether the value of **isSystemApp** is **true**. +2. Check whether the **AllowAppDataNotCleared** field is configured for the application. You can run the [bm commands](../../../readme/bundle-management.md#bm-commands) to query the application information and check whether the value of **userDataClearable** is **true**. -- GitLab