HarmonyOS 鸿蒙Next 项目中引入第三方SDK har包后报错问题 项目中引入了第三方的SDK的har包后报错,生成的har包build model模式是release,报错信息是Error message: cannot find record 'pkg_modules/.ohpm/collect@u5kp
HarmonyOS 鸿蒙Next 项目中引入第三方SDK har包后报错问题
项目中引入了第三方的SDK的har包后报错,生成的har包build model模式是release,报错信息是Error message: cannot find record ‘pkg_modules/.ohpm/collect@u5kp
项目中引入了第三方的SDK的har包后报错,生成第三方的SDK的har包的build model模式是release,报错信息如下:
如果生成第三方的SDK的har包的build model模式是默认default,在项目中引入第三方的SDK的har包启动没有报错,正常。但发布到生产环境har包肯定build model模式是release,现在报错,选择build model模式是默认default项目运行正常,这是为啥?
Pid:18739
Uid:20020048
Reason:ReferenceError
Error name:ReferenceError
Error message:cannot find record ‘pkg_modules/.ohpm/collect@u5kpqkuwv1noljnfbabuciwvwcznsylpqitirsq3spg=/pkg_modules/collect/Index’, please check the request path.’/data/storage/el1/bundle/basic/ets/modules.abc’.
Stacktrace:
Cannot get SourceMap info, dump raw stack:
#01 pc 00000000006f6517 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#02 pc 000000000031587c /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#03 pc 00000000001b0898 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#04 pc 00000000001b0111 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#05 pc 000000000023b811 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#06 pc 00000000005dfbf5 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#07 pc 00000000005dc43e /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#08 pc 000000000055b929 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#09 pc 00000000005491de /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#10 pc 000000000054f369 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#11 pc 000000000054f118 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#12 pc 000000000054f3b4 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#13 pc 000000000054f118 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#14 pc 000000000054f3b4 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
#15 pc 000000000054f118 /system/lib64/platformsdk/libark_jsruntime.so(6f306b256dbb3000a575c27df2874d7c)
更多关于HarmonyOS 鸿蒙Next 项目中引入第三方SDK har包后报错问题 项目中引入了第三方的SDK的har包后报错,生成的har包build model模式是release,报错信息是Error message: cannot find record 'pkg_modules/.ohpm/collect@u5kp的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
可以先关闭混淆试试
参考文档,配置 enable字段为 false关闭混淆:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5#开启代码混淆
再在 混淆规则配置文件 obfuscation-rules.txt 中添加规则
-disable-obfuscation
取消所有混淆
更多关于HarmonyOS 鸿蒙Next 项目中引入第三方SDK har包后报错问题 项目中引入了第三方的SDK的har包后报错,生成的har包build model模式是release,报错信息是Error message: cannot find record 'pkg_modules/.ohpm/collect@u5kp的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html