You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
具体原因是在 DCUniMPSDK.releaseWgtToRunPath 小程序释放时,报错,-5 : "Entry at offset zero has invalid LFH signature 2d2d2d2d" 。 重新尝试用官方HBuilder打包wgt并下发到Android15手机上打开是正常的。
问题:
使用非HBuilder开发的UniApp小程序SDK,并打包wgt,最后运行到Android15手机时打开失败。
具体描述:
方式是用uni-app的命令行,uni build -p app 打包,然后再把 app目录压缩成zip,并重命名为.wgt。之前这个模式运行了2年都OK的,最近发现在Android15(小米、vivo、荣耀都尝试过,一样的情况)手机上打开失败。
具体原因是在 DCUniMPSDK.releaseWgtToRunPath 小程序释放时,报错,-5 : "Entry at offset zero has invalid LFH signature 2d2d2d2d" 。 重新尝试用官方HBuilder打包wgt并下发到Android15手机上打开是正常的。
压缩部分代码(node):
`const archiver = require('archiver');
const fileName = '/dist/build/' + manifest.appid + '.wgt'
const outputPath = path.join(process.cwd(), fileName)
// 创建可写流来写入数据
const output = fs.createWriteStream(outputPath);// 将压缩包保存到当前项目的目录下,并且压缩包名为test.zip
const archive = archiver('zip', {zlib: {level: 9}});// 设置压缩等级
output.on('close', function() {
console.log(archive.pointer() + ' total bytes');
console.log('打包结束');
});
archive.pipe(output);
archive.directory(path.join(process.cwd(), '/dist/build/app/'), false);// 文件流
archive.finalize();`
有尝试修改过level改成0,store:true 非压缩模式等,也一样的报错。
请教下如何解决?
不希望用HBuilder的原因是希望可以本地脚本直接运行部署,且项目人员流动大,不定期会有其他同事支持开发或修改小程序,HBuilder打包需要登录,且不同人账号开发同一个小程序需要额外设置。
The text was updated successfully, but these errors were encountered: