Hello!
I’m integrating SDKBOX IAP into a cocos 3.14 project. iOS works just fine, Android compiles and runs, but I get a crash when I try to purchase the item with this error message:
JNI DETECTED ERROR IN APPLICATION: jstring is an invalid local reference: 0x1 (0xdead4321)
in call to GetStringUTFChars
from void com.sdkbox.plugin.IAPWrapper.nativeOnPayResult(java.lang.String, int, java.lang.String)
I can’t init my product list. (NDK r12b, r16b) In the previous version initialization works
E SDKBOX_CORE: Checking plugin status for unknown plugin: iap
D IAP : creating Products list:
I SDKBOX_CORE: Initialization request for plugin: 'com/sdkbox/plugin/SDKBoxIABBillingClient'
E SDKBOX_CORE: Plugin com/sdkbox/plugin/SDKBoxIABBillingClient not found.
W System.err: java.lang.ClassNotFoundException: com.sdkbox.plugin.SDKBoxIABBillingClient
W System.err: at java.lang.Class.classForName(Native Method)
W System.err: at java.lang.Class.forName(Class.java:324)
W System.err: at java.lang.Class.forName(Class.java:285)
W System.err: at com.sdkbox.plugin.SDKBox.initPlugin(SDKBox.java:186)
W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeRender(Native Method)
W System.err: at org.cocos2dx.lib.Cocos2dxRenderer.onDrawFrame(Cocos2dxRenderer.java:105)
W System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1647)
W System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1352)
W System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sdkbox.plugin.SDKBoxIABBillingClient" on path: DexPathList[[zip file "/mnt/asec/com.quizgeek-2/base.apk"],nativeLibraryDirectories=[/mnt/asec/com.quizgeek-2/lib/arm, /mnt/asec/com.quizgeek-2/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
W System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
W System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
W System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
W System.err: ... 8 more
W System.err: Suppressed: java.lang.ClassNotFoundException: com.sdkbox.plugin.SDKBoxIABBillingClient
W System.err: at java.lang.Class.classForName(Native Method)
W System.err: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
W System.err: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
W System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
W System.err: ... 9 more
W System.err: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
I IAP : AndroidManifest has no store metadata. Defaulting to 'googleplay
E IAP : Can't create IAP java object of type: ''.
E SDKBOX_CORE: JNIInvoke with null obj ref.
E SDKBOX_CORE: JNIInvoke with null obj ref.
E SDKBOX_CORE: JNIInvoke with null obj ref.
E SDKBOX_CORE: JNIInvoke with null obj ref.
I can’t use support-annotations-27.1.1.jar because it conflicted with android-support-v4.jar in facebook_lib. com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
without support-annotations-27.1.1.jar and PluginGooglePlay.jar I have that problem on initialization.
E SDKBOX_CORE: Checking plugin status for unknown plugin: iap
D IAP : creating Products list:
I SDKBOX_CORE: Initialization request for plugin: 'com/sdkbox/plugin/SDKBoxIABBillingClient'
I IAP : AndroidManifest has no store metadata. Defaulting to 'googleplay
D SDKBoxIABBillingClient: BillingClient: Start connection...
D SDKBoxIABBillingClient: handlePurchaseResult:-1
W BillingClient: getPurchaseHistory is not supported on current device
D SDKBoxIABBillingClient: handlePurchaseResult:-2
D SDKBoxIABBillingClient: onBillingSetupFinished:0
I returned to the old versions because I could not compile IAP, GA, and Facebook together (Multiple dex files define ). Now I use cocos 3.17 sdkbox 2.4.3.3 and it works.