[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
    }
}

Read More: