使用ServiceAbility例程,在执行Gradle: Download hap-3.0.3.4 pom...时报错?
Starting Gradle Daemon...
Gradle Daemon started in 2 s 153 ms
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'ServiceAbility'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.huawei.ohos:hap:3.0.3.4.
Required by:
project :
> Could not resolve com.huawei.ohos:hap:3.0.3.4.
> Could not get resource 'https://repo.huaweicloud.com/repository/maven/com/huawei/ohos/hap/3.0.3.4/hap-3.0.3.4.pom'.
> Could not GET 'https://repo.huaweicloud.com/repository/maven/com/huawei/ohos/hap/3.0.3.4/hap-3.0.3.4.pom'.
> Connect to repo.huaweicloud.com:443 [repo.huaweicloud.com/127.0.1.2] failed: Connection refused: connect
> Could not resolve com.huawei.ohos:hap:3.0.3.4.
> Could not get resource 'https://developer.huawei.com/repo/com/huawei/ohos/hap/3.0.3.4/hap-3.0.3.4.pom'.
> Could not GET 'https://developer.huawei.com/repo/com/huawei/ohos/hap/3.0.3.4/hap-3.0.3.4.pom'.
> Connect to developer.huawei.com:443 [developer.huawei.com/127.0.1.3] failed: Connection refused: connect
> Could not resolve com.huawei.ohos:hap:3.0.3.4.
> Could not get resource 'https://jcenter.bintray.com/com/huawei/ohos/hap/3.0.3.4/hap-3.0.3.4.pom'.
> Could not GET 'https://jcenter.bintray.com/com/huawei/ohos/hap/3.0.3.4/hap-3.0.3.4.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/127.0.1.4] failed: Connection refused: connect
* Get more help at https://help.gradle.org
CONFIGURE FAILED in 33s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.1/userguide/command_line_interface.html#sec:command_line_warnings
与DevEco Studio无关,重装Windows 10系统就可以了。