微信小游戏: Failed to download package for %s 4aGsrZzohDNKpivyOlzMee

在为什么在微信开发工具中预览正常,在微信上预览出现黑屏,报错码:
Failed to download package for %s 4aGsrZzohDNKpivyOlzMee

Failed to load scene: Error: [AssetLibrary] loading JSON or dependencies failed: JSON Loader: Parse json [res/import/08/08a5e19e0.json] failed : SyntaxError: Unexpected token < in JSON at position 0

如果资源服务器是内网的话,看看是不是在同一个网络下,外网的话看下开了调试模式没有

问题解决了:
1、首先删除res下资源的时候不要删掉启动场景的资源
2、不要在game.js文件中设置wxDownloader.REMOTE_SERVER_ROOT 资源下载地址
3、在main.xx.js文件中找到启动首个场景的代码,设置资源下载地址:如下
cc.director.loadScene(launchScene, null,
function () {
if (cc.sys.isBrowser) {
// show canvas
canvas.style.visibility = ‘’;
var div = document.getElementById(‘GameDiv’);
if (div) {
div.style.backgroundImage = ‘’;
}
}
cc.loader.onProgress = null;
console.log('Success to load scene: ’ + launchScene);
wxDownloader.REMOTE_SERVER_ROOT = “https://xx.com/wechatgame1.0”;
}
);

json解析出错,把数据删了重新打开游戏看看

1赞

怎么删除微信小游戏本地缓存呢,删除上排小游戏icon吗