Sdkbox undefined in cocos 1.6.1

Hello Everyone,
I’m working an old project developed on Cocos 1.6.1. I wanted to integrate the Facebook Login and so I’ve imported SDKBOX GUI(1.3.9) sucessfully in the cocos creator and imported the facebook module.

But, when making a build, I’m getting the below error

jni/…/…/…/Classes/PluginFacebookJS.cpp:595: error: undefined reference to ‘sdkbox::PluginFacebook::fetchFriends()’
jni/…/…/…/Classes/PluginFacebookJS.cpp:86: error: undefined reference to ‘sdkbox::PluginFacebook::isLoggedIn()’
jni/…/…/…/Classes/PluginFacebookJS.cpp:461: error: undefined reference to ‘sdkbox::PluginFacebook::logout()’
jni/…/…/…/Classes/PluginFacebookJS.cpp:341: error: undefined reference to ‘sdkbox::PluginFacebook::init()’
jni/…/…/…/Classes/PluginFacebookJS.cpp:402: error: undefined reference to ‘sdkbox::PluginFacebook::setGDPR(bool)’
jni/…/…/…/Classes/PluginFacebookJS.cpp:174: error: undefined reference to ‘sdkbox::PluginFacebook::setLoginBehavior(int)’
jni/…/…/…/Classes/PluginFacebookJS.cpp:668: error: undefined reference to ‘sdkbox::PluginFacebook::login()’
jni/…/…/…/Classes/PluginFacebookJS.cpp:661: error: undefined reference to ‘sdkbox::PluginFacebook::login(std::vector<std::string, std::allocatorstd::string >&)’
jni/…/…/…/Classes/PluginFacebookJS.cpp:680: error: undefined reference to ‘sdkbox::PluginFacebook::getAccessToken()’
jni/…/…/…/Classes/PluginFacebookJS.cpp:114: error: undefined reference to ‘sdkbox::PluginFacebook::getSDKVersion()’
jni/…/…/…/Classes/PluginFacebookJS.cpp:142: error: undefined reference to ‘sdkbox::PluginFacebook::getUserID()’

and more

Your help appreciated!
@yinjimmy @moehrleslack_z

You need to link sdkbox static library with android.mk application.mk

I’ve also tried adding lines to AppDelegate.cpp file as mentioned in other posts. But those lines are already present in the file but instead of se-> I have sc->

I tried upgrading the project but getting black screen on the browser view and the simulator view looks freezed

I was thinking that maybe using the lower version of sdkbox might solve this issue for me. Because people earlier with version Cocos Creator 1.6.1 might have successfuly integrated the Facebook Login into their project and compiled for native android app, In this case, I wanted to know which download link & sdkbox version is compatible for cocos creator 1.6.1

@yinjimmy Yes they are already mentioned i guess

Android.mk under proj.android-studio\app\jni

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2djs_shared

LOCAL_MODULE_FILENAME := libcocos2djs

ifeq ($(USE_ARM_MODE),1)
LOCAL_ARM_MODE := arm
endif

LOCAL_SRC_FILES := hellojavascript/main.cpp
…/…/…/Classes/AppDelegate.cpp
…/…/…/Classes/PluginFacebookJS.cpp
…/…/…/Classes/PluginFacebookJSHelper.cpp
…/…/…/Classes/SDKBoxJSHelper.cpp
ifeq ($(USE_ANY_SDK),1)
LOCAL_SRC_FILES += …/…/…/Classes/SDKManager.cpp …/…/…/Classes/jsb_anysdk_basic_conversions.cpp …/…/…/Classes/manualanysdkbindings.cpp …/…/…/Classes/jsb_anysdk_protocols_auto.cpp
endif

LOCAL_CPPFLAGS := -DSDKBOX_ENABLED
-DSDKBOX_COCOS_CREATOR
LOCAL_LDLIBS := -landroid
-llog
LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/…/Classes
LOCAL_WHOLE_STATIC_LIBRARIES += PluginFacebook
LOCAL_WHOLE_STATIC_LIBRARIES += sdkbox

LOCAL_STATIC_LIBRARIES := cocos2d_js_static
LOCAL_WHOLE_STATIC_LIBRARIES := PluginProtocolStatic

LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2
-DCOCOS2D_JAVASCRIPT

include $(BUILD_SHARED_LIBRARY)
$(call import-add-path, $(LOCAL_PATH))

$(call import-module, scripting/js-bindings/proj.android)
$(call import-module, ./sdkbox)
$(call import-module, ./PluginFacebook)

Application.mk under proj.android-studio\app\jni

APP_STL := gnustl_static

Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices

APP_ABI := armeabi-v7a

APP_CPPFLAGS := -frtti
-std=c++11
-fsigned-char
APP_LDFLAGS := -latomic

To solve windows commands char length too long

APP_SHORT_COMMANDS := true

USE_ARM_MODE := 1
#USE_ANY_SDK

ifeq ($(USE_ANY_SDK),1)
APP_CPPFLAGS += -DPACKAGE_AS
endif

ifeq ($(NDK_DEBUG),1)
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1
APP_OPTIM := debug
else
APP_CPPFLAGS += -DNDEBUG
APP_OPTIM := release
endif
APP_PLATFORM := android-15

I guess it has something to do with the sdkbox version & Android sdk and ndk versions.
I’m trying different sdk& ndk versions and tried modifying files but it didnt work.

Could you please let me know which version of sdkbox can be used for facebook login in cocos creator 1.6.1 along with ndk & android sdk version to use. I’m going crazy over this

Thank you
@nite @yinjimmy

The sdkbox libraries are compiled with ndk r14.

Could you please provide some more details @yinjimmy

  1. Which SDKBOX version should i use with Cocos Creator 1.6.1 for Facebook login (Android/iOS). Also can you provide download link for this ?
    2)Which Gradle version, NDK & Android SDK version I should use for cocos creator 1.6.1 to make the build sucessfully with this sdkbox
  2. Earlier you mentioned that I need to link static libraries into android.mk & application.mk.
    I had posted the content that is present currently in those files. Is that correct ? Or should I change something in that file ?
  3. Could you try creating a empty project with cocos creator 1.6.1 and import the facebok plugin from current sdkbox version. You can see that error by yourself.

This issue is so bugging me. All of your help greatly appreciated.
Thank you.

there is a example with cocos creator 2.0

@yinjimmy
Yes, But this is for cocos creator 2.0. My project is in cocos creator 1.6.1 version.
I couldnt upgrade to 2.0 version. Is there solution available for cocos 1.6.1 version ?

Also if you could answer following, it would be great.

  1. Which SDKBOX version should i use with Cocos Creator 1.6.1 for Facebook login (Android/iOS). Also can you provide download link for this ?
    2)Which Gradle version, NDK & Android SDK version I should use for cocos creator 1.6.1 to make the build sucessfully with this sdkbox
  2. Earlier you mentioned that I need to link static libraries into android.mk & application.mk.
    I had posted the content that is present currently in those files. Is that correct ? Or should I change something in that file ?
  3. Could you try creating a empty project with cocos creator 1.6.1 and import the facebok plugin from current sdkbox version. You can see that error by yourself.

Thank you

v2.5.1.2

ndk r16

no 1.6.1 anymore, only find V1.8 version.