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:
- Command not found: ADB appears on Mac
- Installation and use of graphviz under mac
- source, ~/.bashrc, ~/.bash_ Profile details
- Mac command not found solution
- The Linux terminal appears bash: setup.bash : no such file or directory, and. Bashrc file
- supervisor ERROR (spawn error)
- 2021-07-27 Android studio:Installed build tools revision 31.0.0 is corrupted.Remove and install ag
- The python version output from the command line is inconsistent with the python version in the current CONDA environment
- [Solved] Android gradle Error: gradle project sync failed. Please fix your project and try again
- How to solve the problem of Cannot find module’npmlog’ when installing nodejs under Linux
- As Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-2: ordinal not in range(128)
- Install Java runtime JRE in Ubuntu 16.04
- How to Fix adb_server_notify: ADB server connection failed
- Manifest merger failed with multiple errors
- The solution of MAC OpenSSL is not available
- Add a warehouse in allprojects repositories and report an error
- Configuring common environment variables in Windows
- Some processing experiences of failed to notify build listener