Install the SDK Package
Updated at:2025-11-03
Runtime environment
The BOS HarmonyOS SDK is compatible with environments running API 5.0.0 (12) or higher.
Install SDK
- Download the BOS HarmonyOS SDK toolkit from the official website.
- Place it in your project directory, for example,
./lib/sdk.har(assuming the current directory is the root directory of the project) - Update the dependencies in the oh-package.json5 file located in the entry directory to include the required dependency.
Plain Text
1 "dependencies": {
2 "@bdbase/bos": "file:../lib/sdk.har"
3 }
- File -> Sync And Refresh Project to update and make the dependency effective
FAQs
- If the following error is encountered during compilation:
Plain Text
1hvigor ERROR: ArkTS:ERROR Failed to execute es2abc.
2Error Message: Error: The input abc file ‘/Users/user/DevEcoStudioProjects/test_har/oh_modules/.ohpm/@bdbase+bos@gu1lksm7jphrvy+88nlwwgx1ljzjciyeijghnl5gdfq=/oh_modules/@bdbase/bos/ets/modules.abc’ owns a higher api version or a higher sdkReleaseType compared to current compilation process
You can try adding compatibleSdkVersionStage: under theproductsitem in build-profile.json5: "beta6",
