[]微信开发者工具,打开Laya发布的包。编译报请先初始化小游戏适配库,详细教程



Wechat Lib:1.9.98, 2018.4.4 17:39:27
code.js:107 Warning!,this class[MiniAdpter] already exist: {init: ƒ}
VM163:1 请先初始化小游戏适配库,详细教程https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0
console.error @ VM163:1
Browser.__init__ @ code.js:7131
(anonymous) @ code.js:7056
GameEx @ code.js:56322
(anonymous) @ code.js:56681
require @ WAGame.js:3
(anonymous) @ WAGame.js:3
(anonymous) @ game.js? [sm]:2
require @ WAGame.js:3
(anonymous) @ gamePage.html:148
VM163:1 gameThirdScriptError
window.focus is not a function
TypeError: window.focus is not a function
    at Function.Browser.__init__ (http://127.0.0.1:61836/game/code.js:7139:21)
    at Function._$GET_clientWidth (http://127.0.0.1:61836/game/code.js:7056:11)
    at new GameEx (http://127.0.0.1:61836/game/code.js:56322:89)
    at http://127.0.0.1:61836/game/code.js:56681:14
    at require (http://127.0.0.1:61836/game/__ ... :13675)
    at http://127.0.0.1:61836/game/__ ... 13424
    at http://127.0.0.1:61836/game/game.js:4:1
    at require (http://127.0.0.1:61836/game/__ ... :13675)
    at http://127.0.0.1:61836/game/gamePage.html:148:80
 
 
 
已邀请:

w1114367261

赞同来自: Prajna

你是不是没下载微信的开发者工具啊!只是下载了ide
QQ截图20180426155559.png

w1114367261

赞同来自:

即便是已经采用LayaAir引擎开发完成的老项目,替换最新版本引擎类库后,在主程序入口的Laya.init()之前,调用MiniAdpter.init()这个方法,去初始化一下适配程序,把预加载的本地包内容放入到wxlocal目录,即可完美支持微信小游戏。
QQ截图20180426161851.png

 

yung

赞同来自:

请先初始化小游戏适配库,详细教程https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0
报错信息里面给了提示

要回复问题请先

商务合作
商务合作