I’m trying to integrate SDKBOX IAPs in my project, I followed the installation guide and it compiles well.
But when the game starts it crashes.
Here is the crash log:
E/AndroidRuntime(13630): java.lang.UnsatisfiedLinkError: No implementation found for void com.sdkbox.plugin.SDKBox.nativeSetAssetManager(android.content.Context, android.content.res.AssetManager) (tried Java_com_sdkbox_plugin_SDKBox_nativeSetAssetManager and Java_com_sdkbox_plugin_SDKBox_nativeSetAssetManager__Landroid_content_Context_2Landroid_content_res_AssetManager_2)
E/AndroidRuntime(13630): at com.sdkbox.plugin.SDKBox.nativeSetAssetManager(Native Method)
E/AndroidRuntime(13630): at com.sdkbox.plugin.SDKBox.init(SDKBox.java:61)
E/AndroidRuntime(13630): at org.cocos2dx.cpp.AppActivity.onCreate(AppActivity.java:40)
E/AndroidRuntime(13630): at android.app.Activity.performCreate(Activity.java:5990)
E/AndroidRuntime(13630): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
E/AndroidRuntime(13630): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
E/AndroidRuntime(13630): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
E/AndroidRuntime(13630): at android.app.ActivityThread.access$800(ActivityThread.java:151)
E/AndroidRuntime(13630): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
E/AndroidRuntime(13630): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(13630): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(13630): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime(13630): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(13630): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(13630): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime(13630): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I get the exact same error. If I used version 1.1.3 everything works. When I upgrade to version 1.1.5 I get the error message joh gets “No implementation found for native Lcom/sdkbox/plugin/SDKBox”. All I did between version 1.1.3 and 1.1.5 is replace “import org.cocos2dx.plugin.PluginWrapper;” with “import com.sdkbox.plugin.SDKBox;” and the references “PluginWrapper.X” with “SDKBox.X”. The folders jni and lib were copied to my local copy. Cleaning and rebuilds do not help. The application crashes on this line “SDKBox.init(this);”. I am sticking with version 1.1.3 for now.
Also, my setup is just like joh too, I have Android 5.1.1 Nexus 7 2013, with Cocos2Dx 3.6.
Here is the snippet of my code that works using version 1.1.3 for comparison. When I replace the import and change PluginWrapper to SDKBox it crashes. (The SDKBox files are also updated per the doc.)
package org.cocos2dx.cpp;
import android.content.Intent;
import org.cocos2dx.plugin.PluginWrapper;
public class AppActivity extends BaseGameActivity {
public static Context mContext;
private static Activity me = null;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(savedInstanceState==null) {
me = this;
mContext = AppActivity.this;
PluginWrapper.init(this); //Crashes on this Lin for 1.1.5
}
protected void onStart() {
super.onStart();
PluginWrapper.onStart();
}
public void onStop() {
super.onStop();
PluginWrapper.onStop();
}
@Override
protected void onPause() {
super.onPause();
PluginWrapper.onPause();
}
@Override
protected void onResume() {
super.onResume();
PluginWrapper.onResume();
}
@Override
public void onBackPressed() {
if(!PluginWrapper.onBackPressed()) {
super.onBackPressed();
}
}
}
I made a new project on Cocos2dx 3.6 and was trying to implement SDKBox IAP 1.1.5. I am getting similar error as Joh. I used the SDKBox installer and modified the Cocos2dxActivity according to the doc.
Did no work for me, I am still getting error when I run the app on a device
No implementation found for void com.sdkbox.plugin.SDKBox.nativeSetAssetManager(android.content.Context, android.content.res.AssetManager) (tried Java_com_sdkbox_plugin_SDKBox_nativeSetAssetManager and Java_com_sdkbox_plugin_SDKBox_nativeSetAssetManager__Landroid_content_Context_2Landroid_content_res_AssetManager_2)
E/AndroidRuntime(32755): java.lang.UnsatisfiedLinkError: No implementation found for void com.sdkbox.plugin.SDKBox.nativeSetAssetManager(android.content.Context, android.content.res.AssetManager) (tried Java_com_sdkbox_plugin_SDKBox_nativeSetAssetManager and Java_com_sdkbox_plugin_SDKBox_nativeSetAssetManager__Landroid_content_Context_2Landroid_content_res_AssetManager_2)
E/AndroidRuntime(32755): at com.sdkbox.plugin.SDKBox.nativeSetAssetManager(Native Method)
E/AndroidRuntime(32755): at com.sdkbox.plugin.SDKBox.init(SDKBox.java:61)
E/AndroidRuntime(32755): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:227)
E/AndroidRuntime(32755): at android.app.Activity.performCreate(Activity.java:5933)
E/AndroidRuntime(32755): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime(32755): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2282)
E/AndroidRuntime(32755): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
E/AndroidRuntime(32755): at android.app.ActivityThread.access$900(ActivityThread.java:147)
E/AndroidRuntime(32755): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
E/AndroidRuntime(32755): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(32755): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(32755): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime(32755): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(32755): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(32755): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
E/AndroidRuntime(32755): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
Thanks “nite”, I tried your hack with LOCAL_WHOLE_STATIC_LIBRARIES, but it did not work for me. I got the same crash at the same line on the init command. Are the sdkbox.jar and compiled binaries available for the nightly download version outside of using the installer?