离线安装失败
const tbsX5Main = Object;
var x5webviewmgr = uni.requireNativePlugin("wrs-x5webviewmgr");
tbsX5Main.mainInit = () =>{
var params = {};
params.downloadWithoutWifi = true;
x5webviewmgr.setDownloadWithoutWifi(params);
var resp = x5webviewmgr.isX5Core();
console.log(resp)
var flag = resp.flag;
if(!flag) {
x5webviewmgr.reset();
let absPath = plus.io.convertLocalFileSystemURL('_www');
absPath +='static/x5Core.apk'
console.log(absPath)
x5webviewmgr.installLocalTbsCore({
coreVersion: 46011, // 内核版本
path: "absPath" // 内核路径
});
x5webviewmgr.setTbsListener((resp)=>{
var opt = resp.opt;
if(opt == "onDownloadFinish") {
//下载结束时的状态,下载成功时errorCode为100,其他均为失败,外部不需要关注具体的失败原因
var errCode = resp.errCode;
} else if(opt == "onInstallFinish") {
// 安装结束时的状态,安装成功时errorCode为200,其他均为失败,外部不需要关注具体的失败原因
var errCode = resp.errCode;
console.log(resp)
let errTip = x5webviewmgr.getX5CoreLoadHelp();
console.log(errTip)
}
});
}
}
export default tbsX5Main;
错误码见图