jsb.Downloader()下载文件一半失败且没回调

 var fileType = ".apk";
    if (true){
        const rootPath = jsb.fileUtils.getWritablePath();
        const filtPath = rootPath + fileName + fileType;
        var downloader = new jsb.Downloader();
        cclog(TAG,"downloadAPK downloader"+downloader);

        downloader.setOnFileTaskSuccess(function(){        
            cclog(TAG,"downloadAPK 下载成功");
        });
        downloader.setOnTaskProgress(function(task, bytesReceived, totalBytesReceived, totalBytesExpected){        
            cclog(TAG,"downloadAPK 已完成大小 = "+bytesReceived);
            cclog(TAG,"downloadAPK 总大小 "+totalBytesReceived);
            cclog(TAG,"downloadAPK 预期大小 "+totalBytesExpected);
        });

        downloader.setOnTaskError(function(){        
            cclog(TAG,"downloadAPK 下载失败");
        });

        downloader.createDownloadFileTask(url, filtPath,"");//创建下载任务
        return;
    }

下载文件就会下载一半失败,(文件稍大会出现 比如大于5M)

2赞

@官方团队

试了几次感觉就跟赌博,有几率成功

downloader 不要用局部变量,
试下 this.downloader = new jsb.Downloader();

有效 感谢