Error: package com.sdkbox.plugin does not exist

cocos2d-x 3.7

I setup SDKBOX and it works well for iOS builds. Now compiling for Android, it breaks the compile:

This kind of errors:

   [javac] /cocos2d/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java:51: error: package com.sdkbox.plugin does not exist
    [javac] import com.sdkbox.plugin.SDKBox;

I did install using sdkbox import iap, follow http://sdkbox-doc.github.io/en/plugins/iap/v3-cpp/#usage and as I said the IAP stuff works on iOS device.

The instructions above refer to some files, which I do not have on my computer

PluginGooglePlay.jar

PluginIAP.jar

sdkbox.jar

where do I get those from?

Update: I found those files in a weird place, it’s down the path of crashlytics? Is this correct?? Would crashlytics use sdkbox?? huh??

/proj.android/kit-libs/com-crashlytics-sdk-android_crashlytics/libs/PluginGooglePlay.jar
/proj.android/kit-libs/com-crashlytics-sdk-android_crashlytics/libs/sdkbox.jar
/proj.android/kit-libs/com-crashlytics-sdk-android_crashlytics/libs/PluginIAP.jar

Should I move those files somewhere else?

Update again:
I copied those three files into cocos2d/cocos/platform/android/java/libs, then I had to also comment out Fabric/Crashlytics because something broke. But that fixed it!

Gotta find out how to add Fabric/Crashlytics to command line builds later…

That could be a bug in SDKBOX installer

I am having the same error. I am using Android Studio and I installed SDKBOK via the console. The jars (all three of them) are present in cocos2d/cocos/platform/android/java/libs, but I still get the error in Cocos2dxActivity.java stating that:

Error:(50, 25) error: package com.sdkbox.plugin does not exist

How do I fix this?

I’m having the same problem, how did you guys fix it ?

Here is the steps to fix this issue
1.update cocos2d/cocos/platform/android/libcocos2dx/build.gradle
Change dependencies
From this

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

To this

dependencies {
    compile fileTree(dir: '../java/libs', include: ['*.jar'])
}

2.Double check your Android.mk to make sure these two are the same.

proj.android/jni/Android.mk
proj.android-studio/app/jni/Android.mk

@nite thanks!

I’m having the same error message, but the solution above doesn’t work for me. I use cocos creator 2.0.1. Any help is greatly appreciated.

plz try Unable to compile CocosCreator 2 project (Android) with SDKBOX AdMob

I’ve tried already several things of this thread, but none works. What exactly I need to do from this thread?

1 Like

plz show me your steps. I try to reproduce your issue.

Hi,

Here are my steps (Cocos Creator 2.0.1, javascript, on mac OS):

  1. I deleted the build folder.
  2. I build again in Cocos Creator. I say yes to include plugin of sdkbox. I import sdkbox ads with checkmark on staging server.
  3. I press compile in Cocos Creator which fails due to different reasons according to native.logs (for instance: package com.sdkbox.plugin does not exist, compileReleaseJavaWithJavac).
  4. I used the files SDKBoxJSHelper.cpp and SDKBoxJSHelper.h, but compilation fails again.

I also looked at the solution of patio, but I’m unable to locate the folder .sdkbox\plugins<plugin folder>\plugin\android\libs on my mac. I assume I need to find this folder in the software folder of Cocos Creator and not in the folder of my project files (and build files).

Thanks for helping me out. Guy

follow your steps, everything ok.

if you use https://www.teamviewer.com/, maybe I can help you.