老板们捞一下我吧!!!!我的问题是:
使用微信开发者工具,真机调试报错。
之后新建了新项目,只有一个简单的scene,调试的时候依然报一样的错。感觉是环境的问题,但不知道怎么改。
看报错像是minigame\assets\game.js 这里
var engineConfig = readJSONSync("engine.config.json");
报出来的。上下文:
/**
* Read a json file and return the object.
* Null will be returned if error occurs when parsing JSON.
* @param {string} path
*/
function readJSONSync(path) {
var manager = wx.getFileSystemManager();
var res = null;
res = JSON.parse(manager.readFileSync(path, "utf8"));
return res;
}
function getBaseUrlAndEngineGlobalSetting(){
/**
* Try to get the url prefix in configure file.
*/
var engineConfig = readJSONSync("engine.config.json");
var urlPrefix = "file:///assets/";
var globalSetting = {};
if (engineConfig && (typeof (engineConfig.globalSetting) === "object")) {
globalSetting = engineConfig.globalSetting;
if (engineConfig.globalSetting.BaseURL || engineConfig.globalSetting.baseURL) {
urlPrefix = engineConfig.globalSetting.BaseURL || engineConfig.globalSetting.baseURL;
}
if (engineConfig.globalSetting.backupURLs) {
urlPrefix = [urlPrefix, ...engineConfig.globalSetting.backupURLs];
if (!engineConfig.globalSetting.globalHTTPRetry) {
console.warn("配置backupURLs后, 推荐配合设置 globalHTTPRetry > 0 来开启全局重试.");
}
}
}
return {urlPrefix,globalSetting}
}
var engineGlobalSettingInfo = getBaseUrlAndEngineGlobalSetting()
请重装一下系统试试