Egret项目打包发布成微信小游戏报错问题

最近再弄微信小游戏的时候发现部分旧的项目打包后在微信开发者打开会报错:

Failed to execute 'bindTexture' on 'WebGLRenderingContext': parameter 2 is not of type "WebGLTextture"

或者

gameThirdScriptError bitmapData.hasCompressed2d is not a function TypeError:

其实原因很简单,就是引擎库已经过时,部分api已经无效所导致的。

解决方法也很简单,在终端执行命令升级egret引擎库版本即可:egret upgrade --egretversion 引擎版本号

 

Egret项目打包发布成微信小游戏报错问题