HarmonyOS 鸿蒙Next:我下载了最新的settings源码,导入到deveco Studio中,编译一直报错

发布于 1周前 作者 ionicwang 来自 鸿蒙OS

HarmonyOS 鸿蒙Next:我下载了最新的settings源码,导入到deveco Studio中,编译一直报错

C:\Users\sp\nodejs\node.exe C:\Users\sp.hvigor\project_caches\fcc5f68b6785819024036e53a0b259e0\workspace\node_modules@ohos\hvigor\bin\hvigor.js clean --mode module -p product=default assembleHap

> hvigor Finished :phone:clean… after 50 ms 

> hvigor UP-TO-DATE :phone:default@PreBuild…  

> hvigor Finished :phone:default@MergeProfile… after 4 ms 

> hvigor Finished :phone:default@BuildNativeWithCmake… after 1 ms 

> hvigor Finished :phone:default@GenerateLoaderJson… after 3 ms 

> hvigor Finished :phone:default@MakePackInfo… after 16 ms 

> hvigor Finished :phone:default@ProcessProfile… after 82 ms 

> hvigor Finished :phone:default@BuildNativeWithNinja… after 2 ms 

> hvigor Finished :phone:default@ProcessResource… after 4 ms 

> hvigor Finished :phone:default@ProcessLibs… after 3 ms 

> hvigor Finished :phone:default@CompileResource… after 153 ms 

> hvigor Finished :phone:default@CompileJS… after 2 ms 

> hvigor ERROR: Failed :phone:default@CompileArkTS… 

> hvigor ERROR: Could not load E:\harmony\hy_project\settings\applications_settings\common\component\src\main\ets\default\headComponent.ets (imported by product/phone/src/main/ets/pages/aboutDevice.ets): parsed module meta info error: can not parsed local dependency E:\harmony\hy_project\settings\applications_settings\common\component\src\main\ets\default\headComponent.ets module.json info

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/wifi.ets:800:24

 Please define an explicit type, not any.

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/volumeControl.ets:30:1

 It’s not a recommended way to export struct with @Entry decorator, which may cause ACE Engine error in component preview mode.

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/developerOptions.ets:38:25

 Please define an explicit type, not any.

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/developerOptions.ets:198:24

 Please define an explicit type, not any.

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/restoreFactorySettings.ets:29:23

 Please define an explicit type, not any.

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/passwordCheck.ets:53:33

 Please define an explicit type, not any.

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/passwordInput.ets:51:29

 Please define an explicit type, not any.

WARN: ArkTS:WARN File: E:/harmony/hy_project/settings/applications_settings/product/phone/src/main/ets/pages/passwordInput.ets:52:32

 Please define an explicit type, not any.

COMPILE RESULT:FAIL {ERROR:1 WARN:8}

> hvigor ERROR: BUILD FAILED in 11 s 675 ms 

Process finished with exit code -1

我根据提示把full sdk里面的ts复制过去后,再编译就一直报这个错,有没有大佬见过这问题啊?



关于HarmonyOS 鸿蒙Next:我下载了最新的settings源码,导入到deveco Studio中,编译一直报错的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。

11 回复

E:\harmony\hy_project\settings\applications_settings\common\component\src\main\ets\default\headComponent.ets (imported by product/phone/src/main/ets/pages/aboutDevice.ets): parsed module meta info error: can not parsed local dependency

看报错是无法解析本地依赖!

找HarmonyOS工作还需要会Flutter的哦,有需要Flutter教程的可以学学大地老师的教程,很不错,B站免费学的哦:https://www.bilibili.com/video/BV1S4411E7LY/?p=17

对啊,看翻译过来是无法解析本地依赖,但是相关文件都有呢,怎么会报这种问题呢

项目导入的时候会在项目根目录自动生成oh-package.json5,里面内容是: { “license”: “ISC”, “devDependencies”: { “@ohos/hypium”: “1.0.6” }, “name”: “application_settings”, “description”: “example description”, “repository”: {}, “version”: “1.0.0”, “dependencies”: { “hypium”: “^1.0.0” } } 编译的时候会一直报: ohpm INFO: fetch meta info of package ‘hypium’ failed - GET https://repo.harmony os.com/ohpm/hypium 404 ohpm ERROR: NOTFOUND package “hypium” not found from all the registries https:// repo.harmonyos.com/ohpm/ ohpm ERROR: Install failed FetchPackageInfo: hypium failed 然后我把"hypium": "^1.0.0"这一行注释掉了,会不会跟这个有关系呢

kanomoh_module是否存在这个依赖呀

找HarmonyOS工作还需要会Flutter的哦,有需要Flutter教程的可以学学大地老师的教程,很不错,B站免费学的哦:https://www.bilibili.com/video/BV1S4411E7LY/?p=17

使用4.0R以上的代码似乎已经没有这个问题了

将settings模块导入后,出现这问题不知道是什么原因导致common模块,在其他地方代码引用不到,将common目录下的代码,都复制过去,再修改引用就可以了

复制到哪里去,修改什么引用,能不能详细说说,我遇到了一样的问题,感谢

使用4.0R以上的代码已经没有该问题了

回到顶部