JNI Detected error in Application

JNI DETECTED ERROR IN APPLICATION: thread Thread[23,tid=15533,Native,Thread*=0xb90501b8,peer=0x12c34090,“GLThread 13757”] using JNIEnv* from thread Thread[27,tid=15581,Native,Thread*=0xb9318408,peer=0x12f89340,“pool-2-thread-1”]
in call to FindClass
from void com.sdkbox.jnibridge.NativeBridge.emitNative(long, java.lang.String, java.lang.Object)

I am gettting the above JNI error. Somebody please tell me what is the cause?
@nite

Which plugin did you use?

AdMob plugin

Any update on this?

We had reports of these issue on other thread. This looks like an issue when the project is using different versions of SDKBOX plugin. Should be able to fix it with replacing everything with latest SDKBOX, are you also experiencing this issue?

Yes, I reported it here: SDKBox AdMob Crash

I don’t know what do you mean by “replacing everything with latest SDKBOX”. I think I have the last version already installed ( v1.0.0.15 )

I can’t reproduce the issue.

Would you please send me all the sdkbox data.

proj.android folder if you use pre-build framework engine.
or
cocos2d/cocos/platform/android/java/libs and proj.android folders if you use source code engine.

I want to check the data.

Thanks,

Sure, I’ll send you a private message. Thanks!

Any news on this?

En, I checked the data, the plugin is v2.2.5.3 .

And I’m digging the issue.

Hello, can you help to test this issue, I think I have fixed it. but can you help me to double check it ?

sdkbox.jar.zip (71.6 KB)

Please backup your skdbox.jar and using mine.

Thank you !
Jimmy

Sure, I’ll test it right now :wink:

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 :confused:
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.

Yes, I test the issue using sdkbox-sample-sdkboxads/cpp, click play placement-1 lots of times, without crash.

How about just setListener once ?

Can you provide a test sample using cocos framework ?

Thank you !
Jimmy

The problem is that I need to call setListener every time the scene reloads, or the PluginSdkboxAds will be pointing to a released scene object.

I’ll try reproducing the crash in a sample project next week. I’m in a hurry here to finish the Android version of my game, but I’ll do it asap I finish the work :wink:

Thank you for your replies!

Can you try this libs.zip (470.2 KB) , replace the proj.android/jni/pluginsdkboxads/libs folder.

I have no pluginsdkboxads folder inside proj.android/jni, so there’s nothing to replace:

I’m using cocos source code engine

cocos/platform/android/jni/

Also looked into that folder, but there is no pluginsdkboxads in there:

If you don’t have pluginsdkboxads in the jni folder, that means the integration is not complete. We try to automate all the integration process, but sometimes it happens. Please follow the manual integration process to double check if all the required files are in place.

http://docs.sdkbox.com/en/plugins/sdkboxads/v3-cpp/#copy-files