HarmonyOS 鸿蒙Next hvigor构建报错
HarmonyOS 鸿蒙Next hvigor构建报错
/Users/wangrongrong/.nvm/versions/node/v18.17.1/bin/node /Users/wangrongrong/.hvigor/project_caches/dec88c375e1ec3ce7acebec47f45fd0a/workspace/node_modules/@ohos/hvigor/bin/hvigor.js --mode module -p module=entry@default -p product=default assembleHap --analyze --parallel --incremental --daemon
> hvigor UP-TO-DATE :entry:default@PreBuild…
> hvigor UP-TO-DATE :entry:default@GenerateMetadata…
> hvigor Finished :entry:default@PreCheckSyscap… after 1 ms
> hvigor UP-TO-DATE :entry:default@CreateBuildProfile…
> hvigor Finished :entry:default@ConfigureCmake… after 1 ms
> hvigor UP-TO-DATE :entry:default@GenerateLoaderJson…
> hvigor UP-TO-DATE :entry:default@MergeProfile…
> hvigor Finished :entry:default@SyscapTransform… after 15 ms
> hvigor Finished :entry:default@BuildNativeWithCmake… after 1 ms
> hvigor UP-TO-DATE :entry:default@MakePackInfo…
> hvigor UP-TO-DATE :entry:default@ProcessProfile…
> hvigor Finished :entry:default@BuildNativeWithNinja… after 1 ms
> hvigor UP-TO-DATE :entry:default@ProcessResource…
> hvigor UP-TO-DATE :entry:default@ProcessLibs…
> hvigor UP-TO-DATE :entry:default@CompileResource…
> hvigor UP-TO-DATE :entry:default@DoNativeStrip…
> hvigor UP-TO-DATE :entry:default@CompileArkTS…
> hvigor Finished :entry:default@BuildJS… after 4 ms
> hvigor UP-TO-DATE :entry:default@CacheNativeLibs…
> hvigor ERROR: Failed :entry:default@PackageHap…
> hvigor ERROR: Tools execution failed.
Command failed with exit code null: java -Dfile.encoding=utf-8 -jar /Users/wangrongrong/Library/Huawei/Sdk/HarmonyOS-NEXT-DP2/base/toolchains/lib/app_packing_tool.jar --mode hap --force true --lib-path /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/entry/build/default/intermediates/stripped_native_libs/default --json-path /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/entry/build/default/intermediates/res/default/module.json --resources-path /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/entry/build/default/intermediates/res/default/resources --index-path /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/entry/build/default/intermediates/res/default/resources.index --pack-info-path /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/entry/build/default/outputs/default/pack.info --out-path /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/entry/build/default/outputs/default/entry-default-unsigned.hap --ets-path /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/entry/build/default/intermediates/loader_out/default/ets
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000000000000, pid=12651, tid=4867
#
# JRE version: (17.0.6+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (17.0.6+10-b829.5, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C 0x0000000000000000
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again
#
# An error report file with more information is saved as:
# /Users/wangrongrong/DevEcoStudioProjects/MyApplication2/hs_err_pid12651.log
#
#
Detail: Please check the message from tools.
> hvigor ERROR: BUILD FAILED in 879 ms
Process finished with exit code -1
下载的IDE有没有问题,这个是最新的:https://developer.huawei.com/consumer/cn/download/
HarmonyOS 鸿蒙Next的hvigor构建报错可能由多种原因引起,如版本不兼容、依赖冲突、配置错误等。请检查以下几点:
- 确保hvigor版本与项目兼容,并符合OpenHarmony的规范。
- 审查项目依赖,解决可能的库冲突,特别是so库重复问题。
- 核对build.gradle文件中的配置,确保所有设置正确无误。
- 清理并重新构建项目,以消除潜在的构建缓存问题。
- 查看详细的构建日志,定位具体错误原因。
如果问题依旧没法解决请加我微信,我的微信是itying888。