生成好签名需要的相关文件后,统一放置到工程根目录的“sign\debug”目录下,然后触发DevEco Studio工程中的Build-\>Build Hap(s)/App(s) -\>Build Hap(s) 进行编译,最后签名失败,报错信息如下:
\> hvigor ERROR: Failed :entry:default@SignHap...
\> hvigor ERROR: Invalid initialization vector
Detail: Signing failed. Reconfigure the signature or clear the D:\work\test2\sign\debug folder and perform signing again.
at D:\work\test2\build-profile.json5
\> hvigor ERROR: BUILD FAILED in 7 s 473 ms
build-profile.json5里面的配置信息如下(密码进行脱敏处理):
“signingConfigs”: [
{
“name”: “default”,
“type”: “HarmonyOS”,
“material”: {
“storePassword”: “",
“certpath”: “./sign/debug/debug_01.cer”,
“keyAlias”: “key_debug_01”,
“keyPassword”: "”,
“profile”: “./sign/debug/txxy_debug_01.p7b”,
“signAlg”: “SHA2xxxxhECDSA”,
“storeFile”: “./sign/debug/key_debug_01.p12”
}
}
],
build-profile.json5文件中密码不能是原文,是经过处理的字符串