手动升级3.3final的ccs到2.1.0.0

我从git上获取到最新的Cocos-2.1目录下的代码,替换了v3.3final下的文件,把新增加的文件也引入到项目中,运行了下tolua下面的genbindings.py文件,成功生成了lua绑定文件;打开ccs2.1.0.0,重新发布了项目,运行的时候提示版本不匹配的错误,请问这个bug要怎么解决呢?


LUA ERROR: ASSERT FAILED ON LUA EXECUTE: The reader build id of your Cocos exported file(\360\356\377\377$) and the reader build id in your Cocos2d-x(2.1.0.0) are not match.
Please get the correct reader(build id \360\356\377\377$)from http://www.cocos2d-x.org/filedown/cocos-reader and replace it in your Cocos2d-x

stack traceback:
: in function ‘createNode’
?:7: in function ‘_create’
?:311: in function <?:310>
(tail call): ?
?:311: in function ‘new’
?:137: in function ‘showLogin’
?:131: in function ‘onEnter’
?:141: in function 'listener

?:394: in function ‘EventDispatcher’
?:236: in function <?:235>

有一处编译不通过,我把最后的flags参数去掉就好了,不知道会不会影响?

断言错误的地方是2.1.0新增加的吧,之前的版本是没有的

里边获取到的你的csb的版本信息是:\360\356\377\377

这个比较奇怪。

方便把你的csb文件给我看看嘛?

怎么发给你呢,附件不支持csb

附件里的csb.zip,报错的应该是LoginScene.csb这个文件,其他csb我也上传了,方便你们对比

测试在cocos framework3.4 没有出问题。

我是用下面的方法创建node的:
self.node_ = cc.CSLoader:createNode(“csb/login/LoginScene.csb”)
self:addChild(self.node_)

我看了下3.4final自带的lua例子是用下面的方法,我改了成下面的方式(请问这2种方式有区别吗?):
self.node_ = ccs.GUIReader:getInstance():widgetFromBinaryFile(“csb/login/LoginScene.csb”)

结果报错了:

Sg iOS(1509,0x3a45b9dc) malloc: *** mach_vm_map(size=774975488) failed (error code=3)
*** error: can’t allocate region
*** set a breakpoint in malloc_error_break to debug
Sg iOS(1509,0x3a45b9dc) malloc: *** error for object 0x289c658: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

widgetfromXXX是1.x时代的方法。

问题找到了,是之前的ccs项目冲突,有写ccb文件发布的时候没更新导致出了这个问题,全部都用新版本的发布一下就好了。。。

我用最新的coco 2.1.5,cocos2d-x 3.4新建工程,运行还是报错ASSERT FAILED ON LUA EXECUTE: The reader build id of your Cocos exported file() and the reader build id in your Cocos2d-x(2.1.0.0) are not match.
Please get the correct reader(build id )from http://www.cocos2d-x.org/filedown/cocos-reader and replace it in your Cocos2d-x
也根据这个替换了reader代码了,求帮助

删除你的csb文件,全部重新导出试试

不行,都是新建发布的

?新建发布是指什么?
尝试用fullPathForFileName获取你加载的文件的全路径,确定加载的是你发布出来的资源。
这个帖子的楼主就是改完reader然后跑去加载旧版本资源所致,确认是不是同一个问题。

2.1.5的版本是和cocos2d-x 3.4配合使用吧

ASSERT FAILED ON LUA EXECUTE: The reader build id of your Cocos exported file(.) and the reader build id in your Cocos2d-x(2.1.0.0) are not match.
Please get the correct reader(build id .)from http://www.cocos2d-x.org/filedown/cocos-reader and replace it in your Cocos2d-x
stack traceback:运行会报这个错误

我也可以用quick加载新版ccs导出的csb文件了,但是控件添加事件都失败了,请教下要如何添加事件呢?