Admob integration fail in cocos2d-js v3.6.1 (sdkbox-admob_v2.2.1.6)

@pabitrapadhy
Error :-

F:\cocos2dx_project\admobtest\frameworks\js-bindings\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxActivity.java
Error:(48, 25) java: package com.sdkbox.plugin does not exist
Error:(225, 9) java: cannot find symbol
symbol: variable SDKBox
location: class org.cocos2dx.lib.Cocos2dxActivity
Error:(258, 9) java: cannot find symbol
symbol: variable SDKBox
location: class org.cocos2dx.lib.Cocos2dxActivity
Error:(264, 9) java: cannot find symbol
symbol: variable SDKBox
location: class org.cocos2dx.lib.Cocos2dxActivity
Error:(270, 9) java: cannot find symbol
symbol: variable SDKBox
location: class org.cocos2dx.lib.Cocos2dxActivity
Error:(279, 9) java: cannot find symbol
symbol: variable SDKBox
location: class org.cocos2dx.lib.Cocos2dxActivity
Error:(286, 13) java: cannot find symbol
symbol: variable SDKBox
location: class org.cocos2dx.lib.Cocos2dxActivity
Error:(324, 13) java: cannot find symbol
symbol: variable SDKBox
location: class org.cocos2dx.lib.Cocos2dxActivity

Well, you miss sdkbox.jar file, do you Integrate AdMob manually?

Thank you.
I have not done it manually. Let me know where do I find(path) sdkbox.jar file in my project. So that I can check.
Let me know how to fix this issue.

My integration stapes :-
1 - I have integrateed sdkbox admob in my project in command prompt.
(admobtest>sdkbox import admob)
2 - Modify ./frameworks/runtime-src/Classes/AppDelegate.cpp to included the following headers:
#include “PluginAdMobJS.hpp”
#include “PluginAdMobJSHelper.h”
3 - Modify the sdkbox_config.json
change the android banner and interstitial id.
4 - I have followd the link (https://github.com/sdkbox/sdkbox-sample-admob)for demo
and I copy content of app.js file from (https://github.com/sdkbox/sdkbox-sample-admob/blob/master/js/src/app.js) to my project’s app.js files .

http://docs.sdkbox.com/en/plugins/admob/

I followed this link when I stated.

All jars should be here:

$ ls frameworks/runtime-src/proj.android/libs/
PluginAdMob.jar              android-support-v4.jar       gps
android-async-http-1.4.8.jar armeabi                      sdkbox.jar

These jar are not available on above mention path.

as you’re using js source project. how about here:

frameworks/cocos2d-x/cocos/platform/android/java/libs/

The bellow code can’t work?

sdkbox import admob

There was no jar files on above mention path. So I manually copy from .sdkbox\plugins\sdkbox-admob_v2.2.1.6\plugin\android\libs to frameworks\runtime-src\proj.android\libs on my project.

By following (this thread) I updated build.gradle as well. How ever problem is still same(java: package com.sdkbox.plugin does not exist).

I import admob by using this command only and it successfully import to my project.

Looks like it can’t find the sdkbox.jar for some reason. which version of cocos2d-x are you using?

cocos2d-js v3.6.1 (sdkbox-admob_v2.2.1.6)

Can paste the build.gradle content for libcocos2dx ?

Before editing build.gradle as bellow.

apply plugin: 'com.android.library'

repositories {
mavenCentral()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    minSdkVersion 10
    targetSdkVersion 22
}

lintOptions {
    abortOnError false
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        res.srcDirs = ['res']
    }
}
}

After editing build.gradle as bellow.(by following this link)

apply plugin: 'com.android.library'

repositories {
mavenCentral()
}

dependencies {
compile fileTree(dir: '../java/libs', include: ['*.jar'])
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    minSdkVersion 10
    targetSdkVersion 22
}

lintOptions {
    abortOnError false
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        res.srcDirs = ['res']
    }
}
}

error is same in both the cases.i.e before editing build.gradle after editing build.gradle.

Hmm, your gradle file looks correct.

Then where is the problem ?

basically your cocos2d-x library can’t find sdkbox.jar, it’s not a very hard problem, just need to find out where is the lib path (cocos2d-x has been changing the lib path in certain release), if you can send a sample project with the same problem to me, I can fix it for you.

My total project is 1.25GB. So it is not possible to attach total project `.So please mention the folder name which are required.
You can download total project from https://we.tl/EhekeXypNf .

I checked out your project, it looks like cocos2d-x version you’re using doesn’t fully supports android studio yet.
When I try building it with cocos compile -p android everything works correctly.

I recommend you update to the latest cocos2d-x which has proj.android-studio project files, which will give you better android studio support.

I am not using android studio or eclipse. I am using cocos-code-ide-2.0.0-beta (Intellij IDEA 14.1.1).
Is it possible to integrate latest sdkbox on cocos2d-js v3.6.1 projects ?
If not do you recommend to upgrading my cocos2d-js version ?

Sure, sdkbox should work with 3.6.1, you just need to use cocos console command to build your project to android

cocos compile -p android