Sdkbox iap android : failed to load config

i am not confident I have everything set up properly as the instructions do not seem to apply to 2.2.6 2dx.

That said, I am getting the above error. Does that mean everything is set up ok and my only problem is the location of the json file?

If so, The script is copying the json file from resources to assets and I have put it everywhere suggested by other threads?

Thanks

This problem sometime caused by incorrect integration in Cocos2dxActivity.java

Here is a running sample project, maybe can help you spot the difference between your integration.

Nite
Many thanks, will try and let you know
R

HI,

I have copied the code identically back into the myapp.java file. I still get failed to load config when trying to get the list of products.

I also get google IAB hasnt been initialised if I try to restore.

The json file is copied on every build from resources into assets.

No idea what the problem is.

I dont think onproductrequestsuccess or onproductsrequestfailure are getting called

i had to remove the ‘override’ from the the end of each virtual declaration as it would not compile, i have never seen this syntax before

is this required? would the ERR: failed to get config data prevent these from being called?

just a reminder it works perfectly on ios

thanks

Can you move the sdkbox::IAP::init() to somewhere later, like creating the first scene?

It’s okey to remove override, yes, if get config data fails, callback won’t work.

hi

thanks, i will try that

eclipse is also playing up, my shopscene up until now has been called globalscene, eclipse stopped compilling with this name so had to change

50 % of the time it wont compile c lib calls (fwrite and fread)

You can always use build_native.py to compile

yes thanks for that

unfortunately delaying the call to sdkbox iap init doesn’t make any difference, i have triple checked everything and been over the other threads with the same kinds of issue

thanks anyway

i found some incorrect (closing) " in the json file (android version), i dont think they were always there, only if you edit a line with textedit within eclipse, however this didnt help

i am unsure of how to build and install a release version, currently i am exporting with a keystore, then using adb to install - do i need to do it this way?

once ive have done it this way if i try to downloade from ide, it complains about signature and i have to delete installed app, however i dont know if downloaded version is capable of accessing the store

also i am signed into the device as myself, must i be a tester to test iap?
thanks

Have wrote a detailed blog about this
http://blog.cocos2d-x.org/2015/06/integrate-iap-for-google-play-with-sdkbox/

Yes, have been following that…

Can you explain more on the release build situation? The android page is not clear on this. What is the recommended way to install a release version on a device? ie export an apk and install with adb? Is there some other way?

Which account should be signed into google play, none, your own or a tester? Thanks

Firstly, did the “failed to load config” message went away?

###For Testing IAP

You don’t need to be a tester in order to test your build.

Here are the steps

  1. create a release build signed with your key.
  2. publish a build to “alpha testing”
  3. wait for 2 hour for google play to sync up
  4. as long as your version number and build number are the same as the one apk you uploaded to “alpha testing” you can test your code locally, even if you modify your code of the local build, as long as the version number is the same you can keep testing it.

No I still get 3 failed to load config messages, the 3rd is truncated :frowning:I also get IAB is not initialised if if I try to restore

ok to the testing, thanks

I think if you’re sure the Activity.java was changed correctly, then it’s probably because the timing of calling sdkbox::IAP::init(), also are you using proguard?

I am not using pro guard to my knowledge. just a standard cocos2dx 2.2.6 project?

i have moved the init call to a button on a scene, still the same problem, so i dont think timing?

thanks

Updated all my android sdks, now i cant use adb for some reason (invalid apk)
here is latest logcat when downloaded from within eclipse
08-07 19:50:30.151: I/Native(7651): ERR: SDKBox IAP: failed to get configuration
08-07 19:50:30.151: I/Native(7651): INF: SDKBox IAP: refresh Products
08-07 19:50:30.151: I/Native(7651): INF: SDKBox IAP: refresh Products
08-07 19:50:30.151: I/Native(7651): INF: SDKBox IA
08-07 19:50:30.151: D/SDKBox IAPGooglePlay(7651): Requesting Products
08-07 19:50:30.151: D/SDKBox IAPGooglePlay(7651): GooglePlay Request result : 1 msg : Google Play IAB hasn’t been initilized. data :

I moved the tostr template definition from the cpp to the h. I don’t seem to be seeing the failed to load config err messages now.

I either get:-

08-08 06:05:04.239: I/Native(8876): ERR: SDKBox IAP: failed to get configuration
08-08 06:05:04.239: I/Native(8876): INF: SDKBox IAP: refresh Products
08-08 06:05:04.239: I/Native(8876): INF: SDKBox IAP: refresh Products
08-08 06:05:04.239: I/Native(8876): INF: SDKBox IA

Or this when I call refresh
08-08 06:08:00.739: I/Native(8876): : refresh Products
08-08 06:08:00.739: I/Native(8876): INF: SDKBox IAP: refresh Products
08-08 06:08:00.739: I/Native(8876): INF: SDKBox IAP: refresh Products
08-08 06:08:00.739: I/Native(8876): INF: SDKBox IAP: refresh Products
08-08 06:08:00.739: I/Native(8876): INF: S
08-08 06:08:00.739: D/SDKBox IAPGooglePlay(8876): Requesting Products
08-08 06:08:00.739: D/SDKBox IAPGooglePlay(8876): GooglePlay Request result : 1 msg : Google Play IAB hasn’t been initilized. data :

Also I get 300 of these on my console output
/Developer/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/…/lib/gcc/arm-linux-androideabi/4.6/…/…/…/…/arm-linux-androideabi/bin/ld: warning: cannot scan executable section 9 of /MyApps/Development/cocos2d-x-2.2.6/projects/MyApp/proj.android/…/…/…/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a(asn1_par.o) for Cortex-A8 erratum because it has no mapping symbols.

Just incase you think this is related.

Also I’m really not certain I’m building correctly for release mode (as your blog says this is necessary). Since I updated all my sdk, I can no longer install an exported apk (release mode) on my device. How do I build for release and download to device from within eclipse?

One other thing, only one library is linked to the properties (cocos). A google play services library was there (I didnt add this, but it was crossed out with a big red x). Should any other libraries be listed there connected with IAP?

Thanks

Could someone outline what libraries are required over and above the sdkbox plugins for IAP?

Just wonder if they are so obvious nobody every mentions them?

For example is google play services required?
Any others?

Thank you