• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Android IAP Crashes app [SOLVED]

Just recently our App is crashing everytime a user try's to buy something. We have tried to reboot our PC to when it was working, and set all the settings back to a working state and it still crashes.
Also we tried the extensions GooglePlayExtension v2.4.0 and the new GooglePlayExtension v2.5.0 with GooglePlayServicesIAP v1.0.0

After Debugging it on Android, this is where the crash is:

Code:
I/yoyo    (21604): BILLING: RequestCode=184594917
I/yoyo    (21604): BILLING: Requesting pcr4crates for purchase
I/yoyo    (21604): BILLING: Launching Buy Intent for pcr4crates
E/AndroidRuntime(21604): FATAL EXCEPTION: Thread-24445
E/AndroidRuntime(21604): Process: com.XXXXXXX.XXXXXX, PID: XXXXX //Blanked out
E/AndroidRuntime(21604): java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
E/AndroidRuntime(21604):        at android.support.v4.app.BaseFragmentActivityGingerbread.checkForValidRequestCode(BaseFragmentActivityGingerbread.java:88)
E/AndroidRuntime(21604):        at android.support.v4.app.BaseFragmentActivityGingerbread.startIntentSenderForResult(BaseFragmentActivityGingerbread.java:75)
E/AndroidRuntime(21604):        at android.support.v4.app.FragmentActivity.startIntentSenderForResult(FragmentActivity.java:77)
E/AndroidRuntime(21604):        at com.StudioFurukawa.PixelCarRacer.RequestPurchase.run(RequestPurchase.java:48)
E/AndroidRuntime(21604):        at com.StudioFurukawa.PixelCarRacer.RunnerBillingService$1.run(RunnerBillingService.java:180)
E/AndroidRuntime(21604):        at java.lang.Thread.run(Thread.java:818)
I/yoyo    (21604): onWindowFocusChanged(false|false)
I/yoyo    (21604): Setting vis flags to 5894
W/yoyo    (21604): AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: af4f0ed4
I/yoyo    (21604): onPause
I/yoyo    (21604): Pausing the Runner
W/yoyo    (21604): AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: af4f0ed4
I/yoyo    (21604): Redrawing the car
I/yoyo    (21604): Setting vis flags to 5894
I/yoyo    (21604): Setting vis flags to 5894
I/yoyo    (21604): onStop
I/yoyo    (21604): googleplayservices extension onStop called
I/yoyo    (21604): onDestroy
I/yoyo    (21604): BILLING: Failing to unbind service Attempt to invoke virtual method 'void android.content.Context.unbindService(android.content.ServiceConnection)' on a null object reference
I/AndroidRuntime(21604): VM exiting with result code 0, cleanup skipped.

Anyone have a solution? We will be trying everything we can in the mean time. Thank you
 
J

Jaime Lpz

Guest
Hi, I am experiencing the same issue as you. Have you been able to find a solution?

I receive the same error when debugging as soon as I call the iap_acquire:

Code:
11-05 20:44:32.015  5034  5034 I yoyo    : BILLING: Loading services...
11-05 20:44:32.015  5034  5034 I yoyo    : BILLING: Attempting to bind to Billing Service
11-05 20:44:32.015  5034  5047 I yoyo    : android.software.leanback = 0
11-05 20:44:32.015  5034  5047 I yoyo    : MANUFACTURER = OnePlus
11-05 20:44:32.019  5034  5034 I yoyo    : BILLING: Service connected
11-05 20:44:32.023  5034  5034 I yoyo    : BILLING: Billing v3 support available
11-05 20:44:32.023  5034  5034 I yoyo    : BILLING: Request sku details
11-05 20:44:32.025  5034  5056 I yoyo    : BILLING: getSkuDetails() at index 0
11-05 20:44:32.030  5034  5034 I yoyo    : BILLING: Request purchase information
11-05 20:44:32.290  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:32.306  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:32.374  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:32.390  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:38.467  5034  5047 I yoyo    : Store available
11-05 20:44:38.468  5034  5047 I yoyo    : BILLING: RequestCode=177594918
11-05 20:44:38.469  5034  5047 I yoyo    : BILLING: Requesting removeadsls for purchase
11-05 20:44:38.496  5034  5060 I yoyo    : BILLING: Launching Buy Intent for removeadsls
11-05 20:44:38.499  5034  5060 E AndroidRuntime: FATAL EXCEPTION: Thread-2040
11-05 20:44:38.499  5034  5060 E AndroidRuntime: Process: com.xxxxxxx.LS, PID: xxxx
11-05 20:44:38.499  5034  5060 E AndroidRuntime: java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at android.support.v4.app.BaseFragmentActivityEclair.checkForValidRequestCode(BaseFragmentActivityEclair.java:64)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at android.support.v4.app.BaseFragmentActivityEclair.startIntentSenderForResult(BaseFragmentActivityEclair.java:45)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at android.support.v4.app.FragmentActivity.startIntentSenderForResult(FragmentActivity.java:75)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at com.xxxxxx.LS.RequestPurchase.run(RequestPurchase.java:48)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at com.xxxxxx.LS.RunnerBillingService$1.run(RunnerBillingService.java:180)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:818)
11-05 20:44:38.557  5034  5034 I yoyo    : onPause
11-05 20:44:38.573  5034  5034 I yoyo    : Pausing the Runner
11-05 20:44:38.574  5034  5034 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: f36d8e7c
I have logged a bug in the mantis bug tracker, hopefully this can be fixed soon.
 
Hi, I am experiencing the same issue as you. Have you been able to find a solution?

I receive the same error when debugging as soon as I call the iap_acquire:

Code:
11-05 20:44:32.015  5034  5034 I yoyo    : BILLING: Loading services...
11-05 20:44:32.015  5034  5034 I yoyo    : BILLING: Attempting to bind to Billing Service
11-05 20:44:32.015  5034  5047 I yoyo    : android.software.leanback = 0
11-05 20:44:32.015  5034  5047 I yoyo    : MANUFACTURER = OnePlus
11-05 20:44:32.019  5034  5034 I yoyo    : BILLING: Service connected
11-05 20:44:32.023  5034  5034 I yoyo    : BILLING: Billing v3 support available
11-05 20:44:32.023  5034  5034 I yoyo    : BILLING: Request sku details
11-05 20:44:32.025  5034  5056 I yoyo    : BILLING: getSkuDetails() at index 0
11-05 20:44:32.030  5034  5034 I yoyo    : BILLING: Request purchase information
11-05 20:44:32.290  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:32.306  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:32.374  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:32.390  5034  5034 I yoyo    : Setting vis flags to 5894
11-05 20:44:38.467  5034  5047 I yoyo    : Store available
11-05 20:44:38.468  5034  5047 I yoyo    : BILLING: RequestCode=177594918
11-05 20:44:38.469  5034  5047 I yoyo    : BILLING: Requesting removeadsls for purchase
11-05 20:44:38.496  5034  5060 I yoyo    : BILLING: Launching Buy Intent for removeadsls
11-05 20:44:38.499  5034  5060 E AndroidRuntime: FATAL EXCEPTION: Thread-2040
11-05 20:44:38.499  5034  5060 E AndroidRuntime: Process: com.xxxxxxx.LS, PID: xxxx
11-05 20:44:38.499  5034  5060 E AndroidRuntime: java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at android.support.v4.app.BaseFragmentActivityEclair.checkForValidRequestCode(BaseFragmentActivityEclair.java:64)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at android.support.v4.app.BaseFragmentActivityEclair.startIntentSenderForResult(BaseFragmentActivityEclair.java:45)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at android.support.v4.app.FragmentActivity.startIntentSenderForResult(FragmentActivity.java:75)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at com.xxxxxx.LS.RequestPurchase.run(RequestPurchase.java:48)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at com.xxxxxx.LS.RunnerBillingService$1.run(RunnerBillingService.java:180)
11-05 20:44:38.499  5034  5060 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:818)
11-05 20:44:38.557  5034  5034 I yoyo    : onPause
11-05 20:44:38.573  5034  5034 I yoyo    : Pausing the Runner
11-05 20:44:38.574  5034  5034 W yoyo    : AL lib: (EE) dlGetIID: dlsymIID :: SL_IID_VOLUME :: f36d8e7c
I have logged a bug in the mantis bug tracker, hopefully this can be fixed soon.
We have 3 people working on trying everything right now, will keep you all posted. Thanks for posting the Bug

If anyone has a solution, please do share.
 
J

Jaime Lpz

Guest
Thanks, please keep me updated.

I will keep you up to date on the bug log.

Thanks
 
Thanks, please keep me updated.

I will keep you up to date on the bug log.

Thanks
SOLVED!

Arbitrary value between 0 and 65536 (16bit) is required for the requestcode. Where the problem lies is in the RunnerBilling.java. As you can see the requestcode is a lot larger than 16 bit. Since this value can be arbitrary, select a value and input it in replace of the retarded number that was there before.

Steps to fix:

1. Go to ( projectdirectory\extensions\GooglePlayServicesIAPExtension\AndroidSource\Java\RunnerBilling.java ) or if you have google services 2.4.0, go to that directory in your project.

2. Open RunnerBilling.java with notepad

3. Search for
mRequestCodeBase = (there should be a long number after this)

5. Change to 16 bit number (0 to 65536). This number is arbitrary. Make it up.

6. Clean and recompile game.

7.
$$ Profit
 
What Value did you put? (0 to 65536)
I tried 1024, 32767, but still getting an error "Can only use 16-bit request code"
 
Last edited:
J

Jaime Lpz

Guest
SOLVED!

Arbitrary value between 0 and 65536 (16bit) is required for the requestcode. Where the problem lies is in the RunnerBilling.java. As you can see the requestcode is a lot larger than 16 bit. Since this value can be arbitrary, select a value and input it in replace of the retarded number that was there before.

Steps to fix:

1. Go to ( projectdirectory\extensions\GooglePlayServicesIAPExtension\AndroidSource\Java\RunnerBilling.java ) or if you have google services 2.4.0, go to that directory in your project.

2. Open RunnerBilling.java with notepad

3. Search for
mRequestCodeBase = (there should be a long number after this)

5. Change to 16 bit number (0 to 65536). This number is arbitrary. Make it up.

6. Clean and recompile game.

7.
$$ Profit
It works!!

Thanks so much for posting the solution.

Cheers!
 
J

Jaime Lpz

Guest
I am still getting error and game getting crash.Will you past the line " mRequestCodeBase = ".
Yes,
I just used a random number between 0 to 65536.

mRequestCodeBase =188 worked form me.

It now does show up the IAP dialogue box. Strangely it says that the item is not available.. I have uploaded a version in Beta testing to see if this solves the issue.
 
Yes,
I just used a random number between 0 to 65536.

mRequestCodeBase =188 worked form me.

It now does show up the IAP dialogue box. Strangely it says that the item is not available.. I have uploaded a version in Beta testing to see if this solves the issue.
make sure you guys have the New Google play IAP extension if you are on 2.5.0 with the Google Play Services.
 
B

bunkerz

Guest
SOLVED!

Arbitrary value between 0 and 65536 (16bit) is required for the requestcode. Where the problem lies is in the RunnerBilling.java. As you can see the requestcode is a lot larger than 16 bit. Since this value can be arbitrary, select a value and input it in replace of the retarded number that was there before.

Steps to fix:

1. Go to ( projectdirectory\extensions\GooglePlayServicesIAPExtension\AndroidSource\Java\RunnerBilling.java ) or if you have google services 2.4.0, go to that directory in your project.

2. Open RunnerBilling.java with notepad

3. Search for
mRequestCodeBase = (there should be a long number after this)

5. Change to 16 bit number (0 to 65536). This number is arbitrary. Make it up.

6. Clean and recompile game.

7.
$$ Profit
Thanks a lot. Worked like a charm.
 
D

DippLeskine

Guest
I had the same issue and this solution worked for me! It first said the product was not available, but when I uploaded the new APK and downloaded it from the Play Store, it worked!
 
Top