I replaced my sdkbox.jar file with the new file you uploaded, cleaned the project and recompiled it. Seems to be more stable (or maybe it’s just my imagination), but still getting this crash at some point:
08-25 15:19:36.451: I/Timeline(7176): Timeline: Activity_launch_request id:com.studioseventiles.tappytiki time:298841076
08-25 15:19:36.485: D/Cocos2dxActivity(7176): onPause()
08-25 15:19:36.485: I/AdColony(7176): [ADC] AdColony pause called.
08-25 15:19:36.505: D/Cocos2dxActivity(7176): onWindowFocusChanged() hasFocus=false
08-25 15:19:36.513: V/SoundPool(7176): autoPause()
08-25 15:19:36.518: D/DynamitePackage(7176): Instantiating com.google.android.gms.ads.ChimeraAdOverlayCreatorImpl
08-25 15:19:36.519: I/Ads(7176): Ad opening.
08-25 15:19:36.580: D/PhoneWindow(7176): notifyNavigationBarColor, color=0x: ff000000, token: android.view.ViewRootImplAO$WEx@b826ec0
08-25 15:19:36.897: W/google-breakpad(7176): ### ### ### ### ### ### ### ### ### ### ### ### ###
08-25 15:19:36.897: W/google-breakpad(7176): Chrome build fingerprint:
08-25 15:19:36.897: W/google-breakpad(7176): 1.0
08-25 15:19:36.897: W/google-breakpad(7176): 1
08-25 15:19:36.897: W/google-breakpad(7176): ### ### ### ### ### ### ### ### ### ### ### ### ###
08-25 15:19:36.897: A/libc(7176): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x100 in tid 7197 (GLThread 29634)
And this logcat NDK-stack:
********** Crash dump: **********
Build fingerprint: 'lge/g3_global_com/g3:6.0/MRA58K/160421432533f:user/release-keys'
pid: 7176, tid: 7197, name: GLThread 29634 >>> com.studioseventiles.tappytiki <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x100
Stack frame #00 pc 006da11c /data/app/com.studioseventiles.tappytiki-1/lib/arm/libcocos2dcpp.so (sdkbox::PluginSdkboxAdsNativeBridgeAdObserver::operator()(std::string const&, _jobject*)+447)
Stack frame #01 pc 006ee483 /data/app/com.studioseventiles.tappytiki-1/lib/arm/libcocos2dcpp.so (Java_com_sdkbox_jnibridge_NativeBridge_emitNative+42)
Stack frame #02 pc 00cdd3cb /data/app/com.studioseventiles.tappytiki-1/oat/arm/base.odex (offset 0x81c000) (void com.sdkbox.jnibridge.NativeBridge.emitNative(long, java.lang.String, java.lang.Object)+142)
Stack frame #03 pc 00cdcadb /data/app/com.studioseventiles.tappytiki-1/oat/arm/base.odex (offset 0x81c000) (void com.sdkbox.jnibridge.NativeBridge$1.run()+214)
Stack frame #04 pc 03d9089d /system/framework/arm/boot.oat (offset 0x2a71000)
I don’t know what’s wrong with my project
Maybe it’s caused because I reload my scene each time the player presses the play again button? I’m setting SDKBOX plugins’ listeners this way:
Scene* GameScene::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = GameScene::create();
// Set SDKBOX Ads listener
CCLOG("PLUGIN SDKBOX ADS/PLAY: SET LISTENER");
#ifdef SDKBOX_ENABLED
sdkbox::PluginSdkboxAds::setListener(layer);
sdkbox::PluginSdkboxPlay::setListener(layer);
#endif
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
So everytime the scene is reloaded, the listener is set again pointing to the new scene object. I’m suspecting of this because I see on the crash dump this line: sdkbox::PluginSdkboxAdsNativeBridgeAdObserver::operator()
What do you think?
Edit: I forgot to say that I created a test button on my game that will shot an ad every time I touch it, and this way I can play lots of ads without crashes. Therefore, crashes are related to the scene reloading in some way (maybe something about the PluginSdkboxAds::setListener
call as I said before).
UPDATE: I can confirm that my crashes are related to the PluginSdkboxAds::setListener
call. I just commented it and no crashes at all! The bad side about this workaround is that now I won’t receive any PluginSdkboxAds callback, but right now I’m not making any use of them aside from a CCLOG to know what’s happening.