Admob crash on start (Android)

Admob crash on start (Android)

I tried to implement AdMob to my game,
I was not able to add it to my game at first try,
so I decided to make a fresh cocos project then add plugins that I need,
and then use it as a template.

So, I made a fresh cocos2d-x project using the command line,
then added the AdMob plugin using SDKBox GUI,
then opened it in Android Studio and tried to run it on my device.
But the game crashes on launch with this error:

java.lang.UnsatisfiedLinkError: No implementation found for void com.sdkbox.plugin.SDKBox.nativeInit(java.lang.Object, java.lang.ClassLoader) (tried Java_com_sdkbox_plugin_SDKBox_nativeInit and Java_com_sdkbox_plugin_SDKBox_nativeInit__Ljava_lang_Object_2Ljava_lang_ClassLoader_2)
 at com.sdkbox.plugin.SDKBox.nativeInit(Native Method)
 at com.sdkbox.plugin.SDKBox.init(
 at com.sdkbox.plugin.SDKBoxActivity.onCreate(
 at org.cocos2dx.cpp.AppActivity.onCreate(
 at android.os.Handler.dispatchMessage(
 at android.os.Looper.loop(
 at java.lang.reflect.Method.invoke(Native Method)
 at java.lang.reflect.Method.invoke(

My environment info:
Win 10
Android Studio 3.4.2
JRE 1.8.0_152
Cmake 3.6
NDK r16
Cocos2d-x 3.17.2
SDKBox GUI 1.1.7

Thanks :pray:

plz check the CMakeLists.txt

are there some codes like:

+# PluginAdMob
+    add_definitions(-DSDKBOX_ENABLED)
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/
+    target_link_libraries(${APP_NAME} ext_PluginAdMob)

check jars?

~/test/cpp3171 [master] $ ls
PluginAdMob.jar     PluginFirebase.jar  PluginIAP.jar       PluginSdkboxAds.jar sdkbox.jar
1 Like

Thanks for the response,
The jar files were fine,
I didn’t have those lines in my CMake file, so I add them, but it gives me a bunch of build errors.
(Maybe I didn’t do that right! I don’t know much about how CMake config works!)

Anyway, I did the job with direct implementation of firebase, and it looks fine so far.
Again thanks for your response :+1:

A SDKBox CMake doc

1 Like