cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.21k stars 7.06k forks source link

[JS-plugin-FB] FAILS in release mode #13767

Open pepeek opened 9 years ago

pepeek commented 9 years ago

Works great in debug but in release mode it throws:

plugin.FacebookAgent.getInstance is not a function

I've double checked that this is called:

    sc->addRegisterCallback(register_all_pluginx_protocols);
    sc->addRegisterCallback(register_pluginx_js_extensions);
    SDEBUG(LEVEL_INFO, "app", "FB JS-support ENABLED", "");

The log shows the FB JS-support ENABLED message. Any hint how could I identify the problem? I've put several log dump messages inside the js_register_pluginx_protocols_FacebookAgent to make sure it is called and it is...

I've tried it with cocos 3.5, 3.7 and 3.8 and all have this same issue.

I know that plugins are not a prio since there is SDKBOX now, but this functionality doesn't work properly on SDKBOX, please support the plugins till the SDKBOX is mature enough.

It seems that the JS compilation messes this, could it be? Note that I use in 3.5 JS compilation from 3.7.1. which fixes the bug with JS source code included. UPDATE: I've tried it with original 3.5 JS compiler and the bug is still there....

pandamicro commented 9 years ago

Facebook JS SDK doesn't support advanced mode, please use

cocos compile -p web -m release

no --advanced

quangmydn commented 8 years ago

Hey, I get error same. I compile with cocos compile -p web -m release but get error Uncaught Error: Invalid argument game.min.js 1862. Facebook Plugin SDK error???

I write by -l JS and using pluginx, plugin-facebook. I upgrade v3.11 (v3.9) and using sdkbox facebook for web, but sdkbox is not defined on web.

Facebook_sdk.js new /_1464152818,,JIT Construction: v2354536,enUS/ old /_1411456395,,JIT Construction: v1425205,zhCN/

you can update edit facebook.js I can not unterstand to do it. Thanks!