Java教程

鸿蒙编译报错:Unable to find the java component with apiVersion 4.

本文主要是介绍鸿蒙编译报错:Unable to find the java component with apiVersion 4.,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

问题现象

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. 

解决方案

修改build.gradle文件:

ohos {
    compileSdkVersion 4
    defaultConfig {
        compatibleSdkVersion 3
    }
}

改成:

ohos {
    compileSdkVersion 5
    defaultConfig {
        compatibleSdkVersion 3
    }
}
这篇关于鸿蒙编译报错:Unable to find the java component with apiVersion 4.的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!