• Runtimes
  • Runtimes crashing when importing my JSON or Binary JSON - Cocos2dx

I have a project that when I export the skeleton as either json or binary it crashes the cocos2dx runtimes. I'm using the newest cocos2dx, windows visual studio, and spine runtimes (confirmed i got rid of the cocos2dx spine folder in <project>/cocos2d/cocos/editor-support/spine). I tried exporting it as a binary and re-importing it into Spine, it also gives an error. Skeletonviewer bombs on the binary jason with:

When I debugged the runtime in my code it was dying on a transform bezel curve while parsing the JSON. Gave this assertion error about the index of a vector being equal to the size

Any clues of where to start?

Related Discussions
...

I exported it as version 4.0 instead of 4.1 and now I'm getting a more coherent error

Interesting! I exported it to a JSON, re-imported it into a new project, exported from the new project, and am getting the same runtime error :/ At least it's repeatable

catsanddogs2.json
2MB

Oh, the version 4.0 one had an error 'skeleton version 4.0 doesn't match runtime version 4.1'. At least I know I'm on the newest runtimes

Sorry you are having trouble!

I tried your JSON in the Skeleton Viewer and it loaded fine. The error you quoted says you are using the 4.1 runtimes, so there may be a bug in the spine-cpp runtime for loading your specific JSON data. My colleague Mario will take a look soon, likely on Monday. In the meantime you could try loading other 4.1 JSON data, like the Spineboy example project, to validate that your 4.1 runtimes are working correctly with some data.

I can confirm the crash in spine-cpp upon loading the .json file. Happens when the defeated-1 is parsed. Investigating.

Thanks for reporting, this has been fixed in the latest commit to the 4.1 and 4.2-beta branch!

Awesome, thats fast turnaround! I'll tell my animator he found a way to make a project so complicated it crashed spine