SDKBox: Manual Integration For Android - Problem


I’ve been trying to link PluginAdMob to my game on Android. I installed the plugin manually. The game compiles but when I call a method on the plugin it causes a crash. For example this code causes a crash:


I think this has to do with the file not being set up right. I followed the advice in the manual integration guide as best I could, but there were some problems. For instance, in the sdkbox-admob_v2.6.0.0 folder there is no actual file. There is just a patch file named I wasn’t sure what to do with that, so I used the file I found in sdkbox-sample-iap-master.

The “Manual Integration For Android” guide explains to:

" Replace extends Cocos2dxActivity with extends com.sdkbox.plugin.SDKBoxActivity"

but when I do that for the file I took from sdkbox-sample-iap-master folder, I end up with a file that looks like this:

package org.cocos2dx.cpp;

import org.cocos2dx.lib.Cocos2dxActivity;

public class AppActivity extends com.sdkbox.plugin.SDKBoxActivity {

That doesn’t look right. I also think that it’s the wrong version anyway.

What I need to know is, where do I get the right version of from? I copied the file to the folder I think this is right but should there be more files in there? Also, do I need a folder with etc as well?

Thanks for reading. I will show the stack of the crash in the next post.

Here is the stack:

Thread-21-[GL Thread 498]

art_sigsegv_fault 0x00000000e2e5eac0

art::FaultManager::HandleFault(int, siginfo*, void*) 0x00000000e2e5f074

art::art_fault_handler(int, siginfo*, void*) (.llvm.8419848004154328202) 0x00000000e2e5ed8b

___lldb_unnamed_symbol25$$app_process32 0x000000006021022e

___lldb_unnamed_symbol2$$ 0x00000000e5b1f070

sdkbox::JNIUtils::cacheEnv(_JavaVM*) 0x00000000b8d7cd3f

sdkbox::JNIUtils::__getEnv() 0x00000000b8d7d078

sdkbox::JNIUtils::__getEnvAttach() 0x00000000b8d7d095

sdkbox::JNIUtils::GetJNIStaticMethodInfo(char const*, char const*, char const*, _JNIEnv*) 0x00000000b8d7db75

sdkbox::Logger::PlatformInit() 0x00000000b8d77b31

It seems like sdkbox wasn’t initialized properly. So what should the file look like?

and put jars in folder

Hi @yinjimmy ,

Thanks for your help on this. I tried the AppActivity file above but I had some problems. When I compile the project I get this error:

error: cannot find symbol super.setEnableVirtualButton(false);

If I comment out this line I can compile.


When I do that the code compiles ok, and runs without any errors. Unfortunately the ads do not show up. I’m not sure if this has anything to do with commenting out super.setEnableVirtualButton(false); or not.

The project I have is set up just like your example project here: is in cocos2dx/platform/android/java/src/org/cocos2dx/lib with the other files, and is in

Is it necessary to complete this part of the manual install?

" Manual Integration for Google Play Services SDK (dependent library only) "

This part is confusing me because I can see the file in the folders, but when I open Android Studio I can’t see it in any of the drop down lists. So it seems like it is not included in the project. Is copying the gps folder, and modifying an important step? Maybe this is why things are not working.

Thanks for your help.

you do not need the gps folder, just use the

Hi @yinjimmy ,

Thanks for your help. Where do I find the files for IAP and SDKBoxPlay that are the right version to work with this. What do I need to add to dependencies in the build.gradle file?


Hi @yinjimmy ,

Ignore this request. I have found the files now. Thanks.

1 Like