Update to Billing Library 4(sdkbox)

Hi there,

Yes, I know that SDKBOX is dead. However, is there any chance that you are going to update it to support Google Billing Library v4?

Ps. Google is forcing to use it starting from 1.11.2022.


I too have noticed this serious problem.

As we all know, SDKBOX is dead.
Probably no update is expected.

Reminder: Starting on August 2, 2022, all new apps must use Billing Library version 4 or newer.
By November 1, 2022, all updates to existing apps must use Billing Library version 4 or newer.

And the problem is not easy.
There are significant API changes between version 4 and version 5, and the methods available in version 4 have been deprecated.
So, in practice, version 5 support is a must.

Unfortunately, there is no open source library available at this time that I can hope to find.

  • Able to control both iOS and Android with a common interface.
  • Support both cocos2d-x 3.x and 4.x
  • Compatible with Billing Library version 5

From where did you find this? You have totally wrong info.
I do have my own framework written, previously it was on version 4 and recently i upgraded to version-5 and i dont have to do any apis changes at all.

Previously i was also using sdkbox, but try to create your own wrapper class once and you dont have to face such issues any more.
I cannot share my code, o/w i might help you.

In conclusion, I think the only way to do this is to create my own implementation of in-app billing for Android.
I have some experience with native integration for Android, so I have started working on it.
If it works, I would like to share the code.

As for iOS, I have no experience with Objective-C, so it is an unknown.

1 Like

Thanks for your replies. Yeah, this is the highest time to spend few days on the wrapper. It will be also a good time to integrate other stores (Amazon, Huawei, Samsung etc.).

@bluewind00 iOS integration should be easier because you don’t have to use any “ndk”. I will share the code when I manage to do it (I hate Obj-C too :P). The priority is Android, sdkbox still works on iOS.

Hello, I am facing the same problem google billing 4 with use sdkbox. Please share source code to replace sdkbox for android

I am still a work in progress.
I will share it when it is finished, but I can’t promise a deadline.
If you are in a hurry you can work on it yourself and share it.
Also, I cannot make it fully compatible with sdkbox::IAP.
I will only implement the features that I use.

Thanks for your share.
did you test in googleplay? and its work?

Of course, I actually made a test purchase on Google Play.
It works fine.

1 Like

Hello, it 's works for android. Please update for IOS. i would like replace sdkbox is it not convenient now

I am not familiar with iOS.
Can someone please share the code for the iOS purchase process.

I used sdkbox for ios, and used your project for Android.
Works well.

1 Like


1 Like

Thanks for your share.

Hello, i tested successful on test device. But after release to production on google play store. Game crash

v4dUdD0okk04lr2Qt0FyTw==/split_config.arm64_v8a.apk!libMyGame.so (_JNIEnv::CallStaticObjectMethod(_jclass*, _jmethodID*, …)+108)
v4dUdD0okk04lr2Qt0FyTw==/split_config.arm64_v8a.apk!libMyGame.so (mingos::IAP::setListener(mingos::IAPEventListener*)+76)

Please check proj.android/app/proguard-rules.pro.
The following description is required.

-keep class iap.** { *; }
-dontwarn iap.**

If an error occurs in the release build even if these are described, I cannot think of the cause.

Hello, It’s fixed bug thank for your support.

Hi @bluewind00
After i upgrade follow your example then i get crash rate very high!
Any one get this problem?

pid: 0, tid: 0 >>> com.myapp.android <<<

#01 pc 0x000000000070dab9 /data/app/~~koGRJuiDmh7LiS3Lzk2FzA==/com.myapp.android-TILglnNWY2pMK75YXUy_0A==/split_config.armeabi_v7a.apk!libMyAppGame.so (cocos2d::Scheduler::update(float)+592)
#02 pc 0x00000000006fd297 /data/app/~~koGRJuiDmh7LiS3Lzk2FzA==/com.myapp.android-TILglnNWY2pMK75YXUy_0A==/split_config.armeabi_v7a.apk!libMyAppGame.so (cocos2d::Director::drawScene()+178)
#03 pc 0x00000000006fede1 /data/app/~~koGRJuiDmh7LiS3Lzk2FzA==/com.myapp.android-TILglnNWY2pMK75YXUy_0A==/split_config.armeabi_v7a.apk!libMyAppGame.so (cocos2d::Director::mainLoop()+76)
#04 pc 0x00000000000357bf /data/app/~~koGRJuiDmh7LiS3Lzk2FzA==/com.myapp.android-TILglnNWY2pMK75YXUy_0A==/oat/arm/base.odex (art_jni_trampoline+94)
#05 pc 0x00000000000d39d5 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
#06 pc 0x00000000004ead9d /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+276)
#07 pc 0x000000000012bd3f /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+166)
#08 pc 0x000000000023f1ef /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+254)
#09 pc 0x0000000000236eaf /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+738)
#10 pc 0x00000000004dec2f /apex/com.android.art/lib/libart.so (MterpInvokeStatic+490)
#11 pc 0x00000000000ce594 /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+20)
#12 pc 0x0000000000488f58 /data/app/~~koGRJuiDmh7LiS3Lzk2FzA==/com.myapp.android-TILglnNWY2pMK75YXUy_0A==/oat/arm/base.vdex (org.cocos2dx.lib.Cocos2dxRenderer.onDrawFrame+20)
#13 pc 0x000000000022fea9 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.18134065572441359314)+248)
#14 pc 0x0000000000236619 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+120)
#15 pc 0x00000000004cdc63 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+698)
#16 pc 0x00000000000d8561 /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+32)
#17 pc 0x0000000000544cb1 /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.guardedRun+3472)
#18 pc 0x00000000005453a9 /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.run+184)
#19 pc 0x00000000000d39d5 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
#20 pc 0x00000000004eac6b /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+282)
#21 pc 0x000000000012bd2d /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+148)
#22 pc 0x00000000003f84e7 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValuesart::ArtMethod*(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+374)
#23 pc 0x00000000003f85f7 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42)
#24 pc 0x00000000004396f5 /apex/com.android.art/lib/libart.so (art::thread::CreateCallback(void*)+1056)
#25 pc 0x0000000000080b13 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
#26 pc 0x0000000000039d23 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

My code is only a sample and is not guaranteed to work perfectly.
I have made this repository private.

No one is blaming you. Can you please share the code so others can contribute also?