Tag Archives: Hongmeng

Mac HarmonyOS Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]

In the MAC environment, during the development of HarmonyOS, the project runs to the simulator and reports the following errors:

Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]

compileSdkVersion and releaseType of the app do not match the apiVersion and releaseType on the device.

Operation steps.

I. If the HDC tool environment variables are not configured, configure them as follows, and skip this step if they have been configured.

1. Open Mac terminal and enter the following command to open the bash_profile file.

open .bash_profile

2. In the bash_profile file, configure the environment variables, here the PATH path, refer to your own sdk path, version 3.0.0.1 is the version corresponding to Toolschains under API Version7 in my own SDK, the value is 3.0.0.1.

export PATH=$PATH:/Users/tangkun/Library/HarmonyOS/Sdk/toolchains/{3.0.0.1}
export CLASSPATH
HDC_SERVER_PORT=7035
launchctl setenv HDC_SERVER_PORT $HDC_SERVER_PORT
export HDC_SERVER_PORT

3. Save the configured environment variables and enter the following command in the open terminal.

source .bash_profile

4. Restart the development tool DevEco-Studio.

Second, the following is the operation of configured HDC environment variables:
In the terminal terminal of DevEco-Studio, enter the following command:

. /hdc shell

(Windows environment does not need the previous . /hdc shell)

Next, enter the following command in the terminal, but this time you do not need to enter . /, in terminal my Huawei emulator output 6.

getprop hw_sc.build.os.apiversion

This apiversion version number 6 is smaller than the version number 7 in my project’s build.gradle and project’s build.gradle, so it causes my project to run on this apiversion version 6 emulator with the following direct error.

The version numbers of entry and application in the build.gradle:
compileSdkVersion 7 and compatibleSdkVersion 7

Solution:

1. lower the compileSdkVersion and compatibleSdkVersion version numbers in the build.gradle file of entry and application to 6.

2. Use an emulator with Api 7 for debugging.

hb set Error: OHOS ERROR] Invalid vendor path: /home/openharmony/vendor (openharmony Compile ubuntu20.04 official document)

ubuntu20.04 hb set error: OHOS ERROR] Invalid vendor path: /home/openharmony/vendor

Compilation error

View environment

View version

Try to delete the ohos_config.json file in the project root directory, and then execute the “hb set” command, it still reports an error

Solution:

Uninstall this one: pip3 uninstall ohos-build
and then execute three lines of code in the source code path

 pythom3 -m  pip install build/lite

 pythom3 -m  pip install ohos-build 

pip3 install build/lite

[Solved] Hongmeng compiles error: Unable to find the java component with apiVersion 4.

Problem phenomenon

SdkError: DOWNLOAD_SDK_ERROR
	 > Cause: Unable to find the java component with apiVersion 4.
	 > Solution: 
		1.Open SDK Manager and download java.
		2.Alternatively, modify the compileSdkVersion settings in the project- and module-level build.gradle files. 

Solution

Modify the build.gradle file:

ohos {
    compileSdkVersion 4
    defaultConfig {
        compatibleSdkVersion 3
    }
}

Change to:

ohos {
    compileSdkVersion 5
    defaultConfig {
        compatibleSdkVersion 3
    }
}

[Solved] Error while deploying HAP reported by Hongmeng deveco studio

It’s been a long time since I used DevEco-Studio, and today I ran a demo that reported an error, which I didn’t want to do.
Error message.
$ hdc file send /Users/likai/DevEcoStudioProjects/player/entry/build/outputs/hap/debug/entry-debug-unsigned.hap /sdcard/1bde11bbf51f4783a54e2e3616f6a0cd/entry-debug-unsigned.hap
$ hdc shell bm install -p /sdcard/1bde11bbf51f4783a54e2e3616f6a0cd/
Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]
$ hdc shell rm -rf /sdcard/1bde11bbf51f4783a54e2e3616f6a0cd
Error while Deploying HAP
Solution.
Find the project’s configuration file config.json, open it and delete “releaseType”: “Beta1” , then run the perfect solution