Integration help for Javascript

Sure, the recommended place to put the js binding files are frameworks/runtime-src/Classes under your project folder

  • for xcode, make sure to drag&drop the files to xcode
  • with android project, make sure to add them in the Android.mk

New error incoming:

19:09:10 In file included from jni/../../Classes/SDKBoxJSHelper.cpp:1:0:
19:09:10 jni/../../Classes/SDKBoxJSHelper.h:6:5: error: 'JSBool' does not name a type
19:09:10      JSBool js_to_number(JSContext *cx, jsval v, double *dp);
19:09:10      ^
19:09:10 jni/../../Classes/SDKBoxJSHelper.cpp:5:5: error: 'JSBool' does not name a type
19:09:10      JSBool js_to_number(JSContext *cx, jsval v, double *dp)
19:09:10      ^

:confounded:

EDIT: Even after changig every JSBool to bool i couldn’t get this thing to work… It’s a mess, that the revolutionary SDKBOX doesn’t work. :cry:

Can you open a new post for this issue?

I need the following info from you to fix this issue
Which version of cocos2d-js are you using?
What’s the value of MOZJS_MAJOR_VERSION from your jsapi.h

Another problem coming up now:

ERR: Chartboost: Failed to get plugin config json

Where i have to put the json file?

sdkbox_config.json needs to go in res

Done that but the error in logcat is even there… I thought of the problem that in cocos-js all resources have to be preloaded…
So maybe I also have to pre-load the json file?
@nite @slackmoehrle

preload? I don’t think there should be a need for this. I can you show me what your resources folder looks like?

Also make sure you also updated Cocos2dxActivity.java according to the documentation. That could also cause this problem.

@nite double-checked and i edited it the way you said (zip attached)
@slackmoehrle ok. picture attached for you
Still not working^^

Cocos2dxActivity.zip (3.8 KB)

Your Cocos2dxActivity looks correct. Can you post your logcat error messages?

Here. It appears when I’m trying to display an ad.
I initialized chartboost by calling sdkbox.PluginChartboost.init(); in main.js

https://goo.gl/ZMFoDw

I created this sample project with chartboost js integration, can you give it a try?

Notice it will show more game by default, if you want it to show ads, you should change to show(“Default”)

Your version is working for me… @nite I’m trying to compare your version with my one to find the mistake… You have any ideas?

Since your version compiles and runs, most likely the error is in java side, also you should double check if there is any error in the json, run it through http://jsonlint.com/ maybe.

Thanks it works now (just copied your whole structure to my project). Don’t know what the problem was in detail but I’m glad that it works. :slight_smile:

Hi!I established sdkbox and now I get a screen emulator first, as it removed?

You can click play to start the app, emulator only shows up in debug build

I have it in the release and not debug

Help me please. I run cocos compile -p android -m release. But in the application I have a blue screen. How to remove it?

Which version and which plugin are you trying to use?