I'm using Cocos2d-x v3.2 with latest Chartboost android SDK v5.5.3. I've done everything mentioned in the SDK Integration document for android but I have very strange error in logcat when my app runs.
This is my initialization code in onCreate()
//Init Chartboost
Chartboost.startWithAppId(this, getString(R.string.chartboost_app_id), getString(R.string.chartboost_app_signature));
Chartboost.setImpressionsUseActivities(true);
Chartboost.setShouldRequestInterstitialsInFirstSession(false);
Chartboost.setDelegate(cbDelegate);
Chartboost.onCreate(this);
And the logcat shows up:
09-07 16:58:21.221: W/System.err(16168): java.lang.Exception: Chartboost Initialization error. Activity or appId or appSignature is invalid
09-07 16:58:21.222: W/System.err(16168): at com.chartboost.sdk.Chartboost$6.run(SourceFile:666)
09-07 16:58:21.222: W/System.err(16168): at com.chartboost.sdk.Chartboost.a(SourceFile:1129)
09-07 16:58:21.222: W/System.err(16168): at com.chartboost.sdk.Chartboost.cacheInterstitial(SourceFile:663)
09-07 16:58:21.222: W/System.err(16168): at com.android.Main.preloadChartboost(Main.java:1078)
09-07 16:58:21.224: W/System.err(16168): java.lang.Exception: Chartboost Initialization error. Activity or appId or appSignature is invalid
09-07 16:58:21.224: W/System.err(16168): at com.chartboost.sdk.Chartboost$9.run(SourceFile:733)
09-07 16:58:21.224: W/System.err(16168): at com.chartboost.sdk.Chartboost.a(SourceFile:1129)
09-07 16:58:21.224: W/System.err(16168): at com.chartboost.sdk.Chartboost.cacheMoreApps(SourceFile:730)
09-07 16:58:21.225: W/System.err(16168): at com.android.Main.preloadChartboost(Main.java:1079)
09-07 16:58:21.698: W/System.err(16168): java.lang.Exception: Chartboost Initialization error. Activity or appId or appSignature is invalid
09-07 16:58:21.698: W/System.err(16168): at com.chartboost.sdk.Chartboost.onCreate(SourceFile:169)
Tell me please, what I do wrong?
After trying a lot of solutions, finally I figured out that issue caused because of caching ad at wrong place.
I previously called Chartboost.cacheInterstitial(CBLocation.LOCATION_DEFAULT);
at init()
method. After moving Chartboost.cacheInterstitial(CBLocation.LOCATION_DEFAULT);
to other place such as onResume()
, this error flew away.
But I have no idea why the logcat says that the error occurs because of invalid appID or appSignature. Too weird!