Failed to find config file: sdkbox_config.json

I am trying to integrate chartboost plugin with cocos2d-x 3.5 for android. I am getting the below error when trying to initialize chartboost.

“Failed to find config file: sdkbox_config.json”

I have followed all the steps mentioned in sdkbox chartboost document. I am not able to find a fix for this issue.

Has anyone had success in integrating charboost with cocos2d-x for android?

We are releasing a new version tomorrow with improved documentation as well. Are you putting sdkbox_config.json in res?

Yes I have put sdkbox_config.json in resources folder. I can see the sdkbox_config.json file in assets folder of my android project, when i import it to eclipse.

sorry, can you show me a screenshot?

I have added screenshots of resources folder of my project and logcat shown in my eclipse.

it needs to be in res

Have moved sdkbox_config.json to res folder. Built the project again.Still getting the same error.

ok, one other thing, can you show my the contents of your Cocos2dxActivity.java

I have edited the Cocos2dxActivity.java file located at following location.
…\cocos2d\cocos\platform\android\java\src\org\cocos2dx\lib

Have also attached my Android.mk file. Kindly look into it and if possible make corrections in the file and send it back.

Files.zip (4.2 KB)

Thanks for the updated document. I was able to find the issue. My project.properties file did not have this reference.
“android.library.reference.1=…/…/cocos2d-x/cocos/platform/android/java”

This reference is removed when I imported my project to eclipse and added libcocos2dx as library file to my project.

I tried building the project without importing to eclipse and now it reades cocos2dxActivity.java but get the following error:

package org.cocos2dx.plugin does not exist.

Can you tell me how to add this plugin.

So, I would

  1. make sure you have all the .jars from plugin/android/libs copied into the correct location

  2. make sure you have all the jni dir also from plugin/android/jni to proj.android/jni/

  3. Make sure your Cocos2dxActivity has these pieces in it.

  • Modify Cocos2dxActivity.java to add the following imports:
import android.content.Intent;
import org.cocos2dx.plugin.PluginWrapper;
  • Second, modify Cocos2dxActivity to edit the onCreate(final Bundle savedInstanceState) function to add a call to PluginWrapper.init(this);. The placement of this call is important. It must be done after the call to onLoadNativeLibraries();. Example:
onLoadNativeLibraries();
PluginWrapper.init(this);
  • Last, we need to insert the proper overrides code. There are a few rules here.
    • If the method listed has not been defined, add it.

    • If the method listed has been defined, add the calls to PluginWrapper in the same existing function.

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		  if(!PluginWrapper.onActivityResult(requestCode, resultCode, data)) {
		    super.onActivityResult(requestCode, resultCode, data);
		  }
	}
	@Override
	protected void onStart() {
		  super.onStart();
		  PluginWrapper.onStart();
	}
	@Override
	protected void onStop() {
		  super.onStop();
		  PluginWrapper.onStop();
	}
	@Override
	protected void onResume() {
		  super.onResume();
		  PluginWrapper.onResume();
	}
	@Override
	protected void onPause() {
		  super.onPause();
		  PluginWrapper.onPause();
	}
	@Override
	public void onBackPressed() {
		  if(!PluginWrapper.onBackPressed()) {
		    super.onBackPressed();
		  }
	}

Hi I have same issue
cocos2d-x-3.6 + sdkbox-iap_cpp_v1.1.4

I tested with pathes assets/sdkbox_config.json, assets/res/sdkbox_config.json, assets/[some folder registered to search path]/sdkbox_config.json
but everything are failed to find this file

I could know the file existance clearly with using “FileUtils::getInstance()->fullPathForFilename(“sdkbox_config.json”).c_str());” in jni code debugging

could you let me know which folders are searched when “sdkbox::IAP::init();” is called?

Make sure the json file is added to the project.

Can you also double check you change the Cocos2dxActivity.java file?

When i checked PluginWrapper code there are no onStart … functions so i excepted these
and i try to find PluginWrapper’s onStart in cocos2d-x 3.6 plugin folder but i can’t find it
what’s wrong?
I generated plugin from source code build script

I am using libPluginProtocol.jar it has PluginWrapper and sdkbox.jar also has same class
the “Multiple dex files define Lorg/cocos2dx/plugin/IAPWrapper” error was occurred
I think every user using plugin-x could have this issue
Could you guide me for this case?

We’re trying to fix this issue. The fix should be in the next release

We fixed this in our 1.1.5 release

Please download the latest version here.
http://cocos2d-x.org/sdkbox

Thanks to your effort It is done well with 1.1.5 version
I let PluginWrapper code be already implemented and added SdkBox functions part
It works well

That’s great~