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.
Read More:
- Mac OS error in make pycaffe times failure error:’python.h’file not found resolved
- The problem of MAC switching JDK version and RN Android JDK version leads to compilation failure. Solve it
- To be solved: one SSD failure, format failure
- Mac: how to show hidden files under Apple Mac operating system
- Solutions for failure to start Axure RP (including failure to uninstall or install. Net framework)
- Command not found: ADB appears on Mac
- Installation and use of graphviz under mac
- Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: … has no certificates at entry AndroidManifest.xml]
- Mac command not found solution
- Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
- Failure [INSTALL_ FAILED_ OLDER_ SDK] solutions
- Failure[INSTALL_FAILED_INCONSISTENT_BUNDLE_VERSION] Error while Deploying HAP
- Failure [DELETE_ FAILED_ INTERNAL_ Error]
- The solution of MAC OpenSSL is not available
- HTTP Error 502.5 – Process Failure (How to Fix)
- Failure of spring boot configuration server port
- Failure [DELETE_ FAILED_ INTERNAL_ Error] and RM APK is unloaded
- Failure [DELETE_ FAILED_ INTERNAL_ After [error], RM APK is unloaded
- Solving failure executing javac, but could not parse the error
- Install and run phantomjs on MAC