目录

编译构建时报错:配置错误问题汇总

编译构建时报错的常见配置类错误汇总如下:

问题现象

问题原因

构建报错:hvigor ERROR: 00303038 Configuration Error Schema validate failed.

Schema校验失败。

构建报错:The type of the target device does not match the deviceType configured in the module.json5 file of the selected module.

targets的deviceType和module.json5中的deviceTypes不匹配。

构建报错:hvigor ERROR: EINVAL: invalid argument.

项目文件路径过长,导致SDK的路径拼接失效。

构建报错:hvigor ERROR: Tools execution failed. spawn Unknown system error -86.

Command Line Tools与DevEco Studio的版本未配套使用。

构建报错:hvigor ERROR: Debug Failure. False expression: Script kind should match provided ScriptKind and sourceFile.scriptKind.

文件扩展名与编译器内部标记的脚本类型不一致。

构建报错:hvigor ERROR:The @ohos/hvigor-ohos-plugin version () is not within the expected range 2.xx(2.xx >= 2.4.0)

内置的hvigor依赖版本不正确。

构建报错:Unknown resource name 'XXX'.

资源没有定义。

构建报错:ERROR: SDK component missing.

SDK未找到。

问题现象

背景知识

编译构建错误码中的配置错误码参考:配置错误码。

问题定位

分析结论

修改建议