CocosStudio Sample crash

Hey there,

I was checking out CocosStudio Samples today.
I came across the game used in Programmers’ Guide for demonstration, was really excited to check it out.

After cloning the project, I added cocos2d contents from a cocos2d-x 3.10 project as there was no library in the repo. I came across an error -

Undefined reference _conv or something.

After a little search came to know that for Xcode 7 need to add -liconv to other linker flag.
I did that and the error was gone and I could build the project successfully. :smile:

But, unfortunately it crashes at the start only.
after a little debugging found that -

_rootNode = CSLoader::createNode("Login.csb");

retuns nullptr and the game crashes.

I guess some issues in the project only or maybe with old Cocos Studio.
@slackmoehrle could you please help me here.
This is the sample I checked.

Please let me know if the issue exists or could be fixed.
really looking forward to check this sample.

library used - cocos2d-x 3.10
latest cocos studio

Regards,
Pabitra

Include libiconv in your project.

Edit: Let me download and try your link too to see the crash.

Thanks
yes, please check it.

I did include the library but the issue is still there.
as in the answers for the stackoverflow question

EDIT: issue is still there after adding the libraries.

@slackmoehrle : were you able to get the crash after adding the library (libiconv) as well ?
I checked by creating a new .csb file with the new cocos studio, and loaded in the sample, seems to work fine, but only the files in the projects crashes, no matter whichever equivalent .csb I load from the project, it always returns nullptr while creating the node.

May be issues with the files only.
anyway those can be fixed or the sample can be updated to working state !!
please let me know.

Thanks :smile:

I’m not seeing a crash after adding libiconv. Can you tell me what crash you are seeing?

Edit: So I created a new v3.10 project using cocos new and I copied in the resources and the source files from the GitHub link that you provided.

I guess, that’s why you are not seeing crash because of a new project created.
Because if I create a new project using Cocos Studio, it works fine.

But the repo code directly ran after adding the libiconv library and a cocos library creates a crash while calling createNode, crashes somewhere at Endian.

Ok, let me check with a new project.
Hopefully it will work.

Thanks Jason.

Regards,

Let me know if you want me to escalate this. One person also contracted me saying they could not load old .csb files in v3.10 also.

if I run the code as you gave it to me, it fails to load Login.csb, crashes.

Yes, that’s right, it crashes there.
Okay, let me check today and let you know by tomorrow.

So, I think this is an issue and I reported it here: https://github.com/cocos2d/cocos2d-x/issues/15288

1 Like