DEV Community

HarmonyOS
HarmonyOS

Posted on

Common errors occur when the app commissioning assistant installs the hap package.

Read the original article:Common errors occur when the app commissioning assistant installs the hap package

Question

What are the common errors that occur when using the App Commissioning Assistant to install a HAP package on a sports watch, and how can they be resolved?

Short Answer

Common installation failures include configuration file errors, signature verification issues, invalid SDK versions, and internal errors. Each can be resolved by correcting configuration values, verifying signature settings, adjusting SDK compatibility, or optimizing JS page size.

Applicable Scenarios

These errors and solutions apply when developers use the App Commissioning Assistant to install applications on sports watches during testing or deployment.

1. Error Code 40 — Configuration File Format Incorrect

Cause:
Improper configuration in the config.json file.

Solutions:

  • Check parameters like compileSdkVersion.
  • Ensure the "label" string (e.g., "$string:squarewatch_MainAbility") and label text are no longer than 22 characters.
  • Verify the app icon size — recommended dimensions are 80 × 80 or 114 × 114 pixels.

2. Error Code 31 — Signature Verification Error

Cause:
Signature or UDID configuration issues.

Solutions:

  • Confirm the watch’s UDID is included in the signature file.
  • Ensure no more than 10 UDIDs are added.
  • Verify that the signature certificate has not expired.

3. Invalid app.apiVersion Field in Configuration File

Cause:
Incompatible SDK version settings.

Example of Incorrect Configuration:

compileSdkVersion 6
defaultConfig {
  compatibleSdkVersion 6
}
Copy codeCopy code
Enter fullscreen mode Exit fullscreen mode

Solution:
Lower the compatibleSdkVersion to match the supported environment.

Correct Configuration:

compileSdkVersion 6
defaultConfig {
  compatibleSdkVersion 3
}
Enter fullscreen mode Exit fullscreen mode

4. Error Code 34 — Internal Error

Cause:
Excessive size of JavaScript files.

Solution:
If a single JS page exceeds 48 KB, reduce its size by splitting components or optimizing code.

Written by Baris Tuzemen

Top comments (0)