调用 BundleInstaller.install 出现错误,看文档不是很理解,有没有大佬弄过,可以教一下怎么处理吗
错误码ID 17700015 多个HAP配置信息不同导致应用安装失败
[] install failed:BusinessError 17700015: Failed to install haps since the configuration information of multi haps is inconsistent.
错误信息
Failed to install the HAPs because they have different configuration information.
错误描述
调用installer模块中的install接口时,多个HAP配置信息不同导致应用安装失败。
可能原因
多个hap包中配置文件中app标签下面的字段信息不一致。
处理步骤
确认多个HAP中配置文件app下面的字段是否一致。
代码
environment.getStorageDataDir().then((path: string) => {
let filePath = path+'/app/xxx/upgrade/entry-default-signed.hap';
let hapFilePaths = [filePath];
let installParam: installer.InstallParam = {
isKeepData: false,
installFlag: 1,
sharedBundleDirPaths: [path + '/app/xxx/upgrade/sharelibrary-default-signed.hsp']
}
installer.getBundleInstaller().then((data: installer.BundleInstaller) => {
data.install(hapFilePaths, installParam, (err: BusinessError) => {
if (err) {
console.error('[] updateBundleForSelf failed:' + err.message);
} else {
console.info('[] updateBundleForSelf successfully.');
}
})
})
})
|