报错截图

Sync failed.

Cause: 1.The hvigorVersion version (2.4.2) is not within the expected range 3.x.x 
(3.x.x >= 3.0.9). 2.The @ohos/hvigor-ohos-plugin version (2.4.2) is not within the 
expected range 3.x.x (3.x.x >= 3.0.9). 
Solution: Change the values of 
hvigorVersion to 3.0.9 and @ohos/hvigor-ohos-plugin to 3.0.9, while updating the 
command line script hvigor-wrapper.js that matches hvigor, which will auto-install
 the respective versions of the tools. Then sync the project again.
 

报错原因

日志中已经明显给出了,报错是 hvigorVersion 版本差异导致的,产生这个问题之前的操作是导入项目到DevEcho Studio中。由于IDE版本差异,原项目是基于 DevEcho Studio 3.x 构建的,导入到 DevEcho Studio 4.x 中而出现的问题。

报错解决

同样日志中也给出了解决方案:

**升级hvigorVersion **,然后再次同步项目。

也就是点击报错截图中蓝色链接即可

在这里插入图片描述

再次构建就能正常运行了

在这里插入图片描述

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐