cocos2d / cocos2d-js

cocos2d-x for JS
http://www.cocos2d-x.org
MIT License
1.86k stars 487 forks source link

sp.SkeletonAnimation(); Constructor for the requested class is not available when using published runtime / packaged apk #1425

Closed tajitaj closed 9 years ago

tajitaj commented 9 years ago

Version: cocos2d-js v3.2 IDE: cocos Code IDE v1.1.0 Android ver: android-20 modules in project.json: ["cocos2d", "extensions", "external", "pluginx", "plugin-facebook"]

Publishing Runtime is ok, but when executing app with spine object it says: Error: Constructor for the requested class is not available, please refer to the API reference. Error occurred on the line where I declared: "var spHero = new sp.SkeletonAnimation(res.spTAHero_json, res.spTAHero_atlas, 1);" but it works well using the PrebuiltRuntimeJs.apk

did I miss something to include when publishing a runtime?

pandamicro commented 9 years ago

It's probably related to this one: https://github.com/cocos2d/cocos2d-js/pull/1132

We will support new sp.SkeletonAnimation soon, but for now, please use sp.SkeletonAnimation.create

tajitaj commented 9 years ago

thanks! sp.SkeletonAnimation.create() works, will be waiting for the update soon