How can I use AddMob in Cocos2D-js project?

Hi Danilf, thanks for taking time to reply.

I tried getInstance with and without brackets with the same result. It appears cocos doesn’t know what object “plugin” is. The error that keeps stopping me is “plugin is not defined”.

Kind regards

@Marteh, Seems your project can’t find pluginx files. You can try to check some links and file copies.

By the way, which version of cocos2d-js you use? In my manual above I use cocos2d-js v3.0.

I am using js v3.2. I wish it could work on 3.2.

After checking where the problem may lie, I discovered it is in AppActivity.java when I call

 "import org.cocos2dx.plugin.PluginWrapper;"

I get the error:

[javac] C:\Android\workspace\Cashmeir\frameworks\runtime-src\proj.android\src\org\cocos2dx\javascript\AppActivity.java:31: error: package org.cocos2dx.plugin does not exist

Obviously it doesn’t know where to find the plugin. If you go to HELP - package org.cocos2dx.plugin does not exist you can see my 6 modified files.

I don’t know the framework well enough to come up with my own solution of how to import org.cocos2dx.plugin, maybe I need to use Android.mk to call my publish folder manually? Or the protocol folder? Hope you can give me a different insight

Try in Cocos2D-x 3.7, need to change some path.
Refer this link : http://chinchenghong.blogspot.com/2015/08/how-to-add-admob-to-cocos2d-x-37-js.html

what about iOS?

Hi every one, im new in cocos2d-x, i try every step to integrate admob to my game, and nothing work,
i use this link http://chinchenghong.blogspot.com/2015/08/how-to-add-admob-to-cocos2d-x-37-js.html,
can any one share a source code solution with cocos2d-x v3.7 or later integrated with admob?