Android Android IAP Crashes app [SOLVED]

Discussion in 'Legacy GameMaker Community Tech Support' started by studio furukawa, Nov 5, 2016.

  1. studio furukawa

    studio furukawa Member

    Joined:
    Jun 22, 2016
    Posts:
    116
    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
     
  2. Jaime Lpz

    Jaime Lpz Member

    Joined:
    Aug 3, 2016
    Posts:
    15
    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.
     
  3. studio furukawa

    studio furukawa Member

    Joined:
    Jun 22, 2016
    Posts:
    116
    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.
     
    DippLeskine likes this.
  4. Jaime Lpz

    Jaime Lpz Member

    Joined:
    Aug 3, 2016
    Posts:
    15
    Thanks, please keep me updated.

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

    Thanks
     
  5. studio furukawa

    studio furukawa Member

    Joined:
    Jun 22, 2016
    Posts:
    116
    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
     
    bunkerz likes this.
  6. ShubhamBansod

    ShubhamBansod Member

    Joined:
    Jun 20, 2016
    Posts:
    191
    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: Nov 6, 2016
  7. Jaime Lpz

    Jaime Lpz Member

    Joined:
    Aug 3, 2016
    Posts:
    15
    It works!!

    Thanks so much for posting the solution.

    Cheers!
     
    studio furukawa likes this.
  8. ShubhamBansod

    ShubhamBansod Member

    Joined:
    Jun 20, 2016
    Posts:
    191
    I am still getting error and game getting crash.Will you past the line " mRequestCodeBase = ".
     
  9. Jaime Lpz

    Jaime Lpz Member

    Joined:
    Aug 3, 2016
    Posts:
    15
    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.
     
    ShubhamBansod likes this.
  10. ShubhamBansod

    ShubhamBansod Member

    Joined:
    Jun 20, 2016
    Posts:
    191
    Worked!! Yeep same happens with me!
     
    studio furukawa likes this.
  11. studio furukawa

    studio furukawa Member

    Joined:
    Jun 22, 2016
    Posts:
    116
    make sure you guys have the New Google play IAP extension if you are on 2.5.0 with the Google Play Services.
     
  12. ShubhamBansod

    ShubhamBansod Member

    Joined:
    Jun 20, 2016
    Posts:
    191
    I have it! But still getting same message from store
     
  13. bunkerz

    bunkerz Guest

    Thanks a lot. Worked like a charm.
     
    studio furukawa likes this.
  14. DippLeskine

    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!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice