I am currently trying to integrate Chartboost into my game. But the game crashes down instantly on Android with the following error:
12-28 22:43:47.262: E/AndroidRuntime(19802): java.lang.UnsatisfiedLinkError: No implementation found for void com.sdkbox.plugin.SDKBox.nativeInit() (tried Java_com_sdkbox_plugin_SDKBox_nativeInit and Java_com_sdkbox_plugin_SDKBox_nativeInit__)
12-28 22:43:47.262: E/AndroidRuntime(19802): at com.sdkbox.plugin.SDKBox.nativeInit(Native Method)
12-28 22:43:47.262: E/AndroidRuntime(19802): at com.sdkbox.plugin.SDKBox.init(SDKBox.java:64)
12-28 22:43:47.262: E/AndroidRuntime(19802): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:305)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.app.Activity.performCreate(Activity.java:6288)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.app.ActivityThread.access$900(ActivityThread.java:177)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.os.Handler.dispatchMessage(Handler.java:102)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.os.Looper.loop(Looper.java:145)
12-28 22:43:47.262: E/AndroidRuntime(19802): at android.app.ActivityThread.main(ActivityThread.java:5942)
12-28 22:43:47.262: E/AndroidRuntime(19802): at java.lang.reflect.Method.invoke(Native Method)
12-28 22:43:47.262: E/AndroidRuntime(19802): at java.lang.reflect.Method.invoke(Method.java:372)
12-28 22:43:47.262: E/AndroidRuntime(19802): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
12-28 22:43:47.262: E/AndroidRuntime(19802): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
from the log, maybe miss
$(call import-module, ./sdkbox)
in Android.mk
This line is not missing, here is my Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)
$(call import-add-path, $(LOCAL_PATH))
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
LOCAL_SRC_FILES := hellocpp/main.cpp ../../Classes/AppDelegate.cpp ../../Classes/HelloWorldScene.cpp ../../Classes/SceneMenu.cpp ../../Classes/SceneGame.cpp
LOCAL_LDLIBS := -landroid -llog
LOCAL_CPPFLAGS := -DSDKBOX_ENABLED
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END
LOCAL_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += PluginChartboost
LOCAL_WHOLE_STATIC_LIBRARIES += sdkbox
# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END
include $(BUILD_SHARED_LIBRARY)
$(call import-module,.)
$(call import-module, ./sdkbox)
$(call import-module, ./pluginchartboost)
# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END
is something else maybe missing?
Can you also double check if you have jni/sdkbox folder?
Also which version of SDKBOX are you using? If you’re using an old version, you might want to upgrade to the latest version with sdkbox update command.
If you can also provide the cocos2d-x version you’re using it would be great
Finally there is a sample project, for chartboost integration, give it a try and see if it works on your device
https://github.com/sdkbox/sdkbox-chartboost-sample
I just completely recompiled the project using the cocos console tool and now it works without any errors. Thank you for your replies.