AdMob error in Cocos Creator 1.9.1

AdMob error in Cocos Creator 1.9.1
0.0 0

#1

Hi, developing team.
I updated latest creator version 1.9.1 and link admob to my game.
I compiled it successfully but it shows black screen on device.

error message is following.

E/jswrapper: ERROR: Uncaught TypeError: Cannot read property 'setListener' of undefined, location: src/project.js:0:0
             STACK:
             [0]onLoad@src/project.js:43214
             [1]anonymous@(no filename):3
             [2]invoke@src/jsb_polyfill.js:3508
             [3]activateNode@src/jsb_polyfill.js:11669
             [4]_activate@src/jsb_polyfill.js:2336
             [5]runSceneImmediate@src/jsb_polyfill.js:21602
             [6]anonymous@src/jsb_polyfill.js:21694
             [7]anonymous@src/jsb_polyfill.js:13737
             [8]anonymous@src/jsb_polyfill.js:10225
             [9]anonymous@src/jsb_polyfill.js:16575
             [10]c@src/jsb_polyfill.js:9374
             [11]77.n.invoke@src/jsb_polyfill.js:9267
             [12]78.l.emit@src/jsb_polyfill.js:9432
             [13]callback@src/jsb_polyfill.js:21734
             [ERROR] (D:/SelfPub/TinkerPuzzle/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/proj.android/../jswrapper/v8/Object.cpp, 519): Invoking function (0xee8b3ee0) failed!

my source code corresponding to this error is following.

    if(cc.sys.isMobile) {
        sdkbox.PluginAdMob.setListener({
            adViewDidReceiveAd: function(name) {},
            adViewDidFailToReceiveAdWithError: function(name, msg) {},
            adViewWillPresentScreen: function(name) {},
            adViewDidDismissScreen: function(name) {},
            adViewWillDismissScreen: function(name) {},
            adViewWillLeaveApplication: function(name) {}
        });
        sdkbox.PluginAdMob.init();
    }

I had the issue like this at creator 1.7 but I fixed it following Cocos creator sdkbox integration error

I checked AppDelegate.cpp file and added codes pointed out above.
So frustrate for the Cocos Creator, whenever it is version up, new issues already fixed occur.
Please help me.


#2

i’m checking on this issue.

UPDATE:
plz manually add bellow codes to AppDelegate.cpp again,

#ifdef SDKBOX_ENABLED
#include "PluginAdMobJS.hpp"
#include "PluginAdMobJSHelper.h"
#endif
#ifdef SDKBOX_ENABLED
se->addRegisterCallback(register_all_PluginAdMobJS);
se->addRegisterCallback(register_all_PluginAdMobJS_helper);
#endif

I’m so sorry for the inconvenience, this issue will be fixed with 2.4.0.1, and the new release be release 05.22 or 05.23.
Thanks,


#3

These code already added when it compiled.
So strange.

At 1.7, 1.8 if I add these code, issue was fixed .
At 1.9.1 even it is added automatically but it is not fixed.


#4

I checked AdMob with Creator 1.9.1, iOS. It works.
I’ll check on Android.


#5

I found the issue on android.