以前1.10的时候是能直接将res里面的raw-asserts移植cdn上自动远程加载的,升级到2.0不行了。
错误提示发来看看
不太可能,这两个版本的资源是一样的
这个是什么问题呢?我是1.9.3升级上来出现了类似的错误的!
2.0.4 ,放到cdn 同样问题,…
2.0.4 ,放到cdn 同样问题,… + 1
改一下源码,发现他是下载失败了,然后没有重新下载,把那里修改为重新下载即可;
wx-downloader.js
的 downloadRemoteFile 的 fail 回调
修改为
fail: function (res) {
cc.error("download fail, try download again most probably will also fail ")
downloadRemoteFile(item, callback)
// before
// // Continue to try download with downloader, most probably will also fail
// callback({
// status: 0,
// errorMessage: res && res.errMsg ? res.errMsg : "Download file failed: " + remoteUrl
// }, null);
}
强制重新下载,请确保你的服务器上肯定有该资源,否则此处会一直失败
ps:修改之后 放到 工程/build-templates/wechatgame/libs/ 下 这样就不用每次编译都去修改啦
改一下源码,发现他是下载失败了,然后没有重新下载,把那里修改为重新下载即可;
wx-downloader.js
的 downloadRemoteFile 的 fail 回调
修改为
fail: function (res) {
cc.error("download fail, try download again most probably will also fail ")
downloadRemoteFile(item, callback)
// before
// // Continue to try download with downloader, most probably will also fail
// callback({
// status: 0,
// errorMessage: res && res.errMsg ? res.errMsg : "Download file failed: " + remoteUrl
// }, null);
}
强制重新下载,请确保你的服务器上肯定有该资源,否则此处会一直失败
ps:修改之后 放到 工程/build-templates/wechatgame/libs/ 下 这样就不用每次编译都去修改啦
非常之感谢
我们的项目也是, 放到 cdn 上,用4G网络访问就会加载不出某些音频文件,发工单咨询阿里云后,他们的工程师说是因为 运行商劫持。
mark
提供测试demo,帮你看看什么原因,正常测试下不会发生这样的问题。
找到问题了!!!
在1.9.2:
把资源移到腾讯云后,删除build后的res资源,运行ok
在2.0.5
把资源移到腾讯云后,只删除build后res下raw-assets资源就不会出现上面问题
特地回来感谢你~此方法好用!
哈哈,确认过眼神,都是被坑过的人。
mark下,防止被坑