Hello,
I’m integrating Chartboost with SDKBox on my Cocos2D-3.7 JS project on Android. I’m able to see the ads, however I have an issue with the listeners. Instead of calling them, the app logs “JS: < no filename=“filename” >:0:too much recursion”.
Here is how I set the listener (called only once of course):
sdkbox.PluginChartboost.init();
sdkbox.PluginChartboost.setListener({
onChartboostDisplay: function() { cc.log("CB Displayed"); }
});
Then I show an ad:
sdkbox.PluginChartboost.show("Default");
Here are the logs from app initialization to the “recursion” issue (perhaps it will help). I also have the IAP plugin installed.
D/dalvikvm(32161): Trying to load lib /data/app-lib/com.johnsmith.mygamedeluxe-1/libcocos2djs.so 0x43d91c70
D/houdini(32161): [32161] Warning error (ID:0x01400486).
D/houdini(32161): [32161] Loading library(version: 4.0.8.45720 RELEASE)... successfully.
D/dalvikvm(32161): Added shared lib /data/app-lib/com.johnsmith.mygamedeluxe-1/libcocos2djs.so 0x43d91c70
D/JniHelper(32161): JniHelper::setJavaVM(0x6d2b6c24), pthread_self() = 1073954880
D/main(32161): cocos_android_app_init
D/TextView(32161): Constructor - Got Res id for appearance for textColorPrimaryInverse
W/ResourceType(32161): Skipping entry 0x1060003 in package table 0 because it is not complex!
D/TextView(32161): Constructor - Got appearance for textColorPrimaryInverse
D/TextView(32161): Constructor -- Got mEditTextBackgroundColor
D/Cocos2dxActivity(32161): model=K011
D/Cocos2dxActivity(32161): product=WW_K011
D/Cocos2dxActivity(32161): isEmulator=false
I/ufoGralloc(32161): Hello, this is UFO GRALLOC/Intel Corporation
D/(32161): droid_create_context : config id = 10 conf->NativeVisualID=4
D/(32161): Pixel Format : GGL_PIXEL_FORMAT_RGB_565
I/(32161): Requested context : GLES 2.0
D/(32161): Pixel Format : GGL_PIXEL_FORMAT_RGB_565
D/cocos2d-x debug info(32161): {
D/cocos2d-x debug info(32161): gl.supports_vertex_array_object: true
D/cocos2d-x debug info(32161): gl.supports_BGRA8888: false
D/cocos2d-x debug info(32161): gl.supports_ATITC: false
D/cocos2d-x debug info(32161): gl.supports_S3TC: true
D/cocos2d-x debug info(32161): cocos2d.x.version: cocos2d-x-3.7
D/cocos2d-x debug info(32161): gl.supports_discard_framebuffer: true
D/cocos2d-x debug info(32161): cocos2d.x.compiled_with_profiler: false
D/cocos2d-x debug info(32161): gl.supports_PVRTC: false
D/cocos2d-x debug info(32161): cocos2d.x.build_type: DEBUG
D/cocos2d-x debug info(32161): gl.renderer: Intel(R) HD Graphics for BayTrail
D/cocos2d-x debug info(32161): gl.supports_ETC1: true
D/cocos2d-x debug info(32161): cocos2d.x.compiled_with_gl_state_cache: true
D/cocos2d-x debug info(32161): gl.version: OpenGL ES 3.0 - Build CL-260519-CI-15.33-24169
D/cocos2d-x debug info(32161): gl.supports_NPOT: true
D/cocos2d-x debug info(32161): gl.max_texture_units: 32
D/cocos2d-x debug info(32161): gl.vendor: Intel
D/cocos2d-x debug info(32161): gl.max_texture_size: 4096
D/cocos2d-x debug info(32161): }
D/CocosPlayClient.cpp(32161): isEnabled = 0
D/CocosPlayClient.cpp(32161): isDemo = 0
D/CocosPlayClient.cpp(32161): isNotifyFileLoadedEnabled = 0
W/dalvikvm(32161): dvmFindClassByName rejecting 'org/cocos2dx/lib/Cocos2dxLocalStorage'
D/cocos2d-x debug info(32161): cocos2d: fullPathForFilename: No file found at script/jsb_boot.jsc. Possible missing file.
D/cocos2d(32161): android build version:19
D/cocos2d-x debug info(32161): JS: frame width 1280
D/cocos2d-x debug info(32161): JS: frame height 736
I/SDKBox(32161): class name : ----com/sdkbox/plugin/SDKBoxIAPGooglePlay----
E/sdkbox(32161): getFingerprintString(build): 0a000000a000
E/sdkbox(32161): getFingerprintString(androidid): 5373d01ece581278
E/sdkbox(32161): getFingerprintString(macaddress): 1c:b7:2c:23:49:cf
D/IabHelper(32161): Querying owned items, item type: inapp
D/IabHelper(32161): Package name: com.johnsmith.mygamedeluxe
D/IabHelper(32161): Calling getPurchases with continuation token: null
D/SDKBox IAPGooglePlay(32161): Requesting Products
D/IabHelper(32161): Owned items response: 0
D/IabHelper(32161): Continuation token: null
D/IabHelper(32161): Querying SKU details.
D/SDKBox IAPGooglePlay(32161): NetWork reachable : true
D/SDKBox IAPGooglePlay(32161): Please retry in a few seconds.
D/IabHelper(32161): Ending async operation: refresh inventory
D/cocos2d-x debug info(32161): JS: switch ad network
D/cocos2d-x debug info(32161): JS: [AdCenter] Init Chartboost
D/PluginFactory(32161): Java class name of plugin PluginChartboost is : com/sdkbox/plugin/PluginChartboost
I/SDKBox(32161): class name : ----com/sdkbox/plugin/PluginChartboost----
D/Chartboost(32161): Register Chartboost
D/IabHelper(32161): Querying owned items, item type: subs
D/IabHelper(32161): Package name: com.johnsmith.mygamedeluxe
D/IabHelper(32161): Calling getPurchases with continuation token: null
D/IabHelper(32161): Owned items response: 0
D/IabHelper(32161): Continuation token: null
D/IabHelper(32161): Querying SKU details.
D/IabHelper(32161): Ending async operation:
D/SDKBox IAPGooglePlay(32161): Query inventory finished.
D/SDKBox IAPGooglePlay(32161): Query inventory was successful.
D/SDKBox IAPGooglePlay(32161): Got product details: []
D/SDKBox IAPGooglePlay(32161): GooglePlay Request result : 0 msg : Product request successful data :[]
I/dalvikvm(32161): Total arena pages for JIT: 11
D/cocos2d-x debug info(32161): create rendererRecreatedListener for GLProgramState
D/cocos2d-x debug info(32161): create rendererRecreatedListener for GLProgramState
D/cocos2d-x debug info(32161): create rendererRecreatedListener for GLProgramState
D/dalvikvm(32161): GC_FOR_ALLOC freed 1024K, 14% free 6999K/8064K, paused 3ms, total 3ms
I/dalvikvm-heap(32161): Grow heap (frag case) to 10.466MB for 3768336-byte allocation
D/dalvikvm(32161): GC_FOR_ALLOC freed 70K, 10% free 10608K/11748K, paused 3ms, total 3ms
D/dalvikvm(32161): GC_FOR_ALLOC freed 34K, 9% free 10706K/11748K, paused 2ms, total 2ms
I/dalvikvm-heap(32161): Grow heap (frag case) to 14.086MB for 3768336-byte allocation
D/dalvikvm(32161): GC_FOR_ALLOC freed 72K, 8% free 14313K/15432K, paused 2ms, total 2ms
I/dalvikvm(32161): Total arena pages for JIT: 12
I/dalvikvm(32161): Total arena pages for JIT: 13
I/dalvikvm(32161): Total arena pages for JIT: 14
I/dalvikvm(32161): Total arena pages for JIT: 15
D/dalvikvm(32161): GC_FOR_ALLOC freed 11705K, 14% free 7008K/8064K, paused 5ms, total 5ms
D/cocos2d-x debug info(32161): JS: [AdCenter] Show ad
D/cocos2d-x debug info(32161): JS: [AdCenter] Show CB: Default
D/dalvikvm(32161): GC_FOR_ALLOC freed 1486K, 21% free 7149K/8944K, paused 3ms, total 3ms
I/dalvikvm-heap(32161): Grow heap (frag case) to 9.676MB for 2785296-byte allocation
D/dalvikvm(32161): GC_FOR_ALLOC freed 6K, 16% free 9863K/11668K, paused 3ms, total 3ms
D/dalvikvm(32161): GC_FOR_ALLOC freed <1K, 14% free 11457K/13264K, paused 2ms, total 3ms
I/dalvikvm(32161): Total arena pages for JIT: 16
D/cocos2d-x debug info(32161): JS: <no filename="filename">:0:too much recursion
I’m on:
Cocos2D-X-3.7 (JS)
Android 4.4.2
NDK r10c
SDKBox 0.5.6.11
Chartboost 1.2.1.0
IAP 1.2.1.0
Has anyone a guess of what’s causing this? Perhaps this topic can help (although the stack quota is already 500000).