[SOLVED]Crash sdkbox.PluginFacebook.inviteFriends + CreatorV1.8.1 + FacebookPluginsV2.3.17.7 + android

Crash by sdkbox.PluginFacebook.inviteFriends + CreatorV1.8.1 + FacebookPluginsV2.3.17.7 + android;
afther i login in success,when i call sdkbox.PluginFacebook.inviteFriends it crash.
can anyone help plz .
here is the crash log.

 01-26 14:29:56.740 9291-9291/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
 01-26 14:29:56.740 9291-9291/? A/DEBUG: Build fingerprint: 'samsung/a7xeltexx/a7xelte:7.0/NRD90M/A710FXXU2CQI7:user/release-keys'
 01-26 14:29:56.740 9291-9291/? A/DEBUG: Revision: '8'
 01-26 14:29:56.740 9291-9291/? A/DEBUG: ABI: 'arm'
 01-26 14:29:56.741 9291-9291/? A/DEBUG: pid: 9031, tid: 9031, name: palmplay.domino  >>> com.ipalmplay.domino <<<
 01-26 14:29:56.741 9291-9291/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xe24
 01-26 14:29:56.741 9291-9291/? A/DEBUG:     r0 00000000  r1 00000000  r2 00000000  r3 c7ad0888
 01-26 14:29:56.741 9291-9291/? A/DEBUG:     r4 00000000  r5 ffb8afb8  r6 c00511e0  r7 c64e51b0
 01-26 14:29:56.741 9291-9291/? A/DEBUG:     r8 00000000  r9 e4d25310  sl ffb8b040  fp ffb8af9c
 01-26 14:29:56.741 9291-9291/? A/DEBUG:     ip c7ab29f4  sp ffb8af68  lr c6a6a325  pc c6a6a328  cpsr 400d0030
 01-26 14:29:56.742 9047-9082/? D/SamsungAnalytics:1.8.25: [DLC Sender] send result success : 0
 01-26 14:29:56.748 9291-9291/? A/DEBUG: backtrace:
 01-26 14:29:56.748 9291-9291/? A/DEBUG:     #00 pc 00c44328  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so
 01-26 14:29:56.748 9291-9291/? A/DEBUG:     #01 pc 00c44379  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so
 01-26 14:29:56.748 9291-9291/? A/DEBUG:     #02 pc 006bd8e0  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so (_ZN2se15AutoHandleScopeC2Ev+36)
 01-26 14:29:56.749 9291-9291/? A/DEBUG:     #03 pc 006bf1fc  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so (_ZN18FacebookListenerJS21onInviteFriendsResultEbRKSs+76)
 01-26 14:29:56.749 9291-9291/? A/DEBUG:     #04 pc 006d7f97  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so (Java_com_sdkbox_plugin_PluginFacebook_onInviteFriendsResult+54)
 01-26 14:29:56.749 9291-9291/? A/DEBUG:     #05 pc 0087b4f1  /data/app/com.ipalmplay.domino-1/oat/arm/base.odex (offset 0x803000)

With the release of the Facebook SDK version 4.28.0, App Invites is deprecated. It will be supported until February 5, 2018.

I think you shouldn’t bother the crash anyway. You’d better use another method for app invites.

thank you,i will try other method. maybe i’ll use requestInvitableFriends and inviteFriendsWithInviteIds.

It crash in JS callback, I’m checking on this.

UPDATE:
Could u plz try bellow code ?

    virtual void onInviteFriendsResult(bool ok, const std::string& msg)
    {
        se::ValueArray args;

        std::string funName(__FUNCTION__);
        cocos2d::Director::getInstance()->getScheduler()->performFunctionInCocosThread([funName,ok,msg,this](){
            se::ScriptEngine::getInstance()->clearException();
            se::AutoHandleScope hs;
            if (!_JSDelegate.isObject())
                return;

            se::Value func;
            _JSDelegate.toObject()->getProperty(funName.c_str(), &func);

            if (func.isObject() && func.toObject()->isFunction()) {

                se::ValueArray params;
                params.push_back(se::Value(ok));
                params.push_back(se::Value(msg));
                bool ok = func.toObject()->call(params, _JSDelegate.toObject());
                if (!ok) {
                    se::ScriptEngine::getInstance()->clearException();
                }
            }
        });
    }

sure i can.

it build failed.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':FishGame:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process E:\android-ndk-r10e\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=E:\games\fish_client\trunk\FishGame\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=E:\games\fish_client\trunk\FishGame\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-15 NDK_OUT=E:/games/fish_client/trunk/FishGame/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=E:\games\fish_client\trunk\FishGame\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\debug\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-22 NDK_MODULE_PATH=E:\games\fish_client\trunk\FishGame\build\jsb-default\frameworks\cocos2d-x;E:\games\fish_client\trunk\FishGame\build\jsb-default\frameworks\cocos2d-x\cocos;E:\games\fish_client\trunk\FishGame\build\jsb-default\frameworks\cocos2d-x\external -j4 NDK_DEBUG=1 E:/games/fish_client/trunk/FishGame/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libcocos2djs.so}
  Android NDK: WARNING: Unsupported source file extensions in E:\games\fish_client\trunk\FishGame\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk for module cocos2djs_shared    
  Android NDK:   ../../../Classes/PluginFacebookJS.hpp ../../../Classes/PluginFacebookJSHelper.h ../../../Classes/SDKBoxJSHelper.h    
  [armeabi-v7a] Compile++ arm  : cocos2djs_shared <= PluginFacebookJSHelper.cpp
  E:/games/fish_client/trunk/FishGame/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/jni/../../../Classes/PluginFacebookJSHelper.cpp:122:15: error: 'virtual void FacebookListenerJS::onInviteFriendsResult(bool, const string&)' cannot be overloaded
    virtual void onInviteFriendsResult(bool ok, const std::string& msg)
                 ^
  E:/games/fish_client/trunk/FishGame/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/jni/../../../Classes/PluginFacebookJSHelper.cpp:113:18: error: with 'virtual void FacebookListenerJS::onInviteFriendsResult(bool, const string&)'
       virtual void onInviteFriendsResult(bool ok, const std::string& msg)
                    ^
  make.exe: *** [E:/games/fish_client/trunk/FishGame/build/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/cocos2djs_shared/__/__/__/Classes/PluginFacebookJSHelper.o] Error 1
  make.exe: *** Waiting for unfinished jobs....

I add MAKE_V8_HAPPY and it could be build.

it case fatal.

01-26 18:14:47.080: A/libc(30505): Fatal signal 6 (SIGABRT), code -6 in tid 30528 (GLThread 23632)
01-26 18:14:47.081: W/(2241): debuggerd: handling request: pid=30505 uid=10402 gid=10402 tid=30528
01-26 18:14:47.163: A/DEBUG(30561): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-26 18:14:47.163: A/DEBUG(30561): Build fingerprint: 'samsung/a7xeltexx/a7xelte:7.0/NRD90M/A710FXXU2CQI7:user/release-keys'
01-26 18:14:47.163: A/DEBUG(30561): Revision: '8'
01-26 18:14:47.163: A/DEBUG(30561): ABI: 'arm'
01-26 18:14:47.163: D/CustomFrequencyManagerService(2897): FrequencyrequestList.getNextMaxCPUCoreRequest, index: 2
01-26 18:14:47.163: A/DEBUG(30561): pid: 30505, tid: 30528, name: GLThread 23632  >>> com.ipalmplay.domino <<<
01-26 18:14:47.163: A/DEBUG(30561): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
01-26 18:14:47.166: D/CustomFrequencyManagerService(2897): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 1600000  uid : 1000  pid : 2897  tag : APP_LAUNCH@CPU_MIN@234
01-26 18:14:47.167: A/DEBUG(30561): Abort message: 'E:/games/fish_client/trunk/FishGame/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/proj.android/../jswrapper/v8/ScriptEngine.cpp:565: bool se::ScriptEngine::start(): assertion "ok" failed'
01-26 18:14:47.167: A/DEBUG(30561):     r0 00000000  r1 00007740  r2 00000006  r3 00000008
01-26 18:14:47.167: A/DEBUG(30561):     r4 c7ea0978  r5 00000006  r6 c7ea0920  r7 0000010c
01-26 18:14:47.167: A/DEBUG(30561):     r8 c7e9ff70  r9 d5f4f500  sl 00000000  fp c7e9fdcc
01-26 18:14:47.167: A/DEBUG(30561):     ip 00000016  sp c7e9fce0  lr e76f04c7  pc e76f2d30  cpsr 600f0010
01-26 18:14:47.174: A/DEBUG(30561): backtrace:
01-26 18:14:47.174: A/DEBUG(30561):     #00 pc 0004ad30  /system/lib/libc.so (tgkill+12)
01-26 18:14:47.174: A/DEBUG(30561):     #01 pc 000484c3  /system/lib/libc.so (pthread_kill+34)
01-26 18:14:47.174: A/DEBUG(30561):     #02 pc 0001dd99  /system/lib/libc.so (raise+10)
01-26 18:14:47.174: A/DEBUG(30561):     #03 pc 00019521  /system/lib/libc.so (__libc_android_abort+34)
01-26 18:14:47.174: A/DEBUG(30561):     #04 pc 00017160  /system/lib/libc.so (abort+4)
01-26 18:14:47.174: A/DEBUG(30561):     #05 pc 0001bd97  /system/lib/libc.so (__libc_fatal+22)
01-26 18:14:47.175: A/DEBUG(30561):     #06 pc 000198ff  /system/lib/libc.so (__assert2+18)
01-26 18:14:47.175: A/DEBUG(30561):     #07 pc 007e215c  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so (_ZN2se12ScriptEngine5startEv+632)
01-26 18:14:47.175: A/DEBUG(30561):     #08 pc 006b573c  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so (_ZN11AppDelegate29applicationDidFinishLaunchingEv+644)
01-26 18:14:47.175: A/DEBUG(30561):     #09 pc 007ba108  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so (_ZN7cocos2d11Application3runEv+40)
01-26 18:14:47.175: A/DEBUG(30561):     #10 pc 007bf010  /data/app/com.ipalmplay.domino-1/lib/arm/libcocos2djs.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+248)
01-26 18:14:47.175: A/DEBUG(30561):     #11 pc 008516d5  /data/app/com.ipalmplay.domino-1/oat/arm/base.odex (offset 0x803000)

but it crash when app starts, not in inviteFriends callback.

ok maybe i have to try clean build

v8/ScriptEngine.cpp:565: bool se::ScriptEngine::start(): assertion “ok” failed’

This is the error.

Do you mean it is Engine’s problem. I try the codes crash too.

Sorry, I don’t know whats going on here. Would u revert the onInviteFriendsResult function ?

BTW, I can not believe the function cause app crash.

@Insgdhr Would u plz send me a APK when u fix the starts crash?

sure, you mean use the revert code?

Yes.

I test this function without facebook native app, and no callback anymore.

I just want use com.facebook.share.model.GameRequestContent to invite friend.I don’t know if i use the right function… here is the test apk if you want test, you have to tell me your facebook test id, so i can add it on the facebook test list.

100003676714850

try inviteFriendsWithInviteIds function.
https://github.com/sdkbox/sdkbox-sample-facebook/blob/master/cpp/Classes/HelloWorldScene.cpp#L297

done , you can try when you ready.