Integration help for c++

Can you check if proj.android/sdkbox.jar is in your libs folder?

Looks correct, what’s the error message you got?

I try using version 1.0.1 and delete all other flags but still get error:

"sdkbox::dataToProduct(char const*)", referenced from:
      sdkbox::IAP::onProductRequestResult(sdkbox::ProductRequestCode, char const*, char const*) in sdkbox(IAP.o)
1 Like

And there isn’t anything I can do to workaround or fix it myself?

Thank you!

Okay it’s working :smiley:

I’m using Eclipse and in my workspace, I’ve got my game folder and also the libcocos2dx folder.
In my game folder, I have already added the folder.proj.android/sdkbox.jar in my libs folder and I also added the java build path of these new JARs, but it wasn’t working.

After that I had the java build path of these new JARs to the libcocos2dx folder, and then this message disappears: “The import org.cocos2dx.plugin cannot be resolved”.

I don’t know if it’s good to do this or if my workspace is properly built.

1 Like

We have also fixed our problem with the Android build following what you did!

The installation guide states that all three .jar files must be copied into your-project-folder/android.proj/libs, but it wasn’t working. But after copying those files into your-project-folder/cocos2d/cocos/platform/android/java/libs and running the native_build.py, it ends in a BUILD SUCCESSFUL message and the APK generated and working!

Thank you! :smiley:

Can you share with me why your app is unique to where you copy the .jars here? I don’t have a lot of Android experience, but I tested each SDKBOX plugins many, many times and the instructions work. So for you and a few others they are not working exactly. I assume it is because you are integrating more SDK’s? Like Soomla?

If so, perhaps I should add a section to the docs that states if you are adding more SDK’s that are not SDKBOX SDK’s to put the jars here your-project-folder/cocos2d/cocos/platform/android/java/libs and run build_native.py after?

@nite can you also help me understand this piece and if a documentation change is beneficial?

I suppose my app is not unique to where .jar files need to be copied as I took the idea from @inakicm Integration help for c++

And I just don’t know why this is working… As I said earlier in this thread, we are using Cocos2d-x 3.4 RC1 with SDKBOX 1.0.1, and the project includes the cocos sources instead of using precompiled binaries.
I also did not override these three methods in Cocos2dxActivity.java file in my-project/cocos2d/cocos/platform/android/java/src/org/cocos2dx/lib/ because the build threw undefined symbol: onStart(), onStop(), onBackPressed(). And the other three, onActivityResult(), onPause()and onResume(), were merged with the same existing methods in the class (is not only copying and pasting the code from the guide PDF into the class).

We are only integrating AdColony with SDKBOX, and no more.

This may be caused by our poor understanding of the Android.mk files, but that is how we get it working thanks to the idea of @inakicm

I hope this helps!

@slackmoehrle I think we can add the eclipse integration step to the documentation.

Can you give me the exact steps you took and I will add an Eclipse integration step to the documentation?

Hi, using cocos console doesnt work for you ?

Can you open a new thread for this issue?

also post your linker flag settings? it will help us nail down the issue, thanks a lot :smile:

It does, but I use build_native.py script instead for some reason I don’t remember right now (may be because I got used to it before they introduced the cocos console). Do you ask for some particular reason?

In the installation_guide.pdf, at the step 2.1 (after the copy of the different JAR files) I simply add these 2 new Java Build Paths to my project in the Java Build Path libraries .
And because I am using Cocos2d-x from source (well I think it’s because of that, I’m not sure) I also add the Java Build Paths of sdkbox.jar to libcocos2dx (libcocos2dx correspond to a separate folder in my eclipse workspace). And it works.

Sorry for the explanation but I’m a new in cocos2d-x.

Hi, I succeed to install SDKBOX for AdColony, but I wanted to add Chartboost and at the end I’ve got this error message: java.lang.NoSuchFieldError:com.chartboost.sdk.Chartboost$CBFramework.CBFrameworkCocos2dx

Do you have an idea of what is wrong?

Try adding chartboost.jar to your build path like this

Right click on chartboost.jar and select Add to Build Path

Hi, I put this code in c++:

sdkbox::PluginChartboost::show(“interstitial” );

and my sdkbox_config.json is:

“ads”:{
“Default”:{
“type”:“interstitial”
},
“Level Complete”:{
“type”:“rewarded_video”
},
“MoreApp”:{
“type”:“more_app”
}
}

Should i use Default or interstitial ?. Thanks

You should use "Default", that’s the name (aka placement) of the ad, and type is the type of the ad.

thanks. I could compile chartboost in my project without errors but i cant see any ads. i use two commands ‘init’ and ‘show’ and i made a button that call ‘show’ again but i cant see nothing.

Can you check the logcat and see if there is any error messages regarding chartboost?
You mentioned that you didn’t add code in Cocos2dxActivty.java that could cause some problem, looking for errors like can't find config file that usually means SDKBox is not been initialized correctly.

Also if you can post your log file in a separate thread, it would be really helpful, since this thread is getting harder to track.