Cordova IAP buy item crashes game

0 favourites
  • 13 posts
From the Asset Store
A fantastic package of 117 high-quality & game-ready sound effects for User Interface, Items, Power-Ups, and more!
  • I set it so Click a button, Request Store listing and purchase product, but when I click the button it says "Unfortunately, my game has stopped."

    On start of layout I have Request Store listing and Add Product ID's. And I do have the Cordova IAP added into Intel XDX and I do have the products set up in the Google Developer Console.

    On start of Layout > Request Store Listing and Add products

    Click button > Request Store listing and Purchase Product "Product ID"

    I have Request store listing on click button in case the person isn't connected to the internet when they get to the layout. Like if they aren't connected to the internet at first, if they get connected to the internet they can click the button and the store listing can be requested then

  • Bump for crash from IAP code. I did Request Store Listing, Add Products, and buy Product ID. I'm not sure why the game is crashing. and I do have it uploaded into Alpha in Google.

  • If it helps, here is the Crash Report from Google, When the game crashed I did a Report:

    "ava.lang.IllegalStateException: IAB helper is not set up. Can't perform operation: launchPurchaseFlow

    at com.smartmobilesoftware.util.IabHelper.checkSetupDone(IabHelper.java:784)

    at com.smartmobilesoftware.util.IabHelper.launchPurchaseFlow(IabHelper.java:374)

    at com.smartmobilesoftware.util.IabHelper.launchPurchaseFlow(IabHelper.java:340)

    at jp.wizcorp.phonegap.plugin.wizPurchase.IAP.buy(IAP.java:348)

    at jp.wizcorp.phonegap.plugin.wizPurchase.IAP.access$200(IAP.java:43)

    at jp.wizcorp.phonegap.plugin.wizPurchase.IAP$2.onIabSetupFinished(IAP.java:278)

    at com.smartmobilesoftware.util.IabHelper$1.onServiceConnected(IabHelper.java:260)

    at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1223)

    at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1240)

    at android.os.Handler.handleCallback(Handler.java:746)

    at android.os.Handler.dispatchMessage(Handler.java:95)

    at android.os.Looper.loop(Looper.java:148)

    at android.app.ActivityThread.main(ActivityThread.java:5491)

    at java.lang.reflect.Method.invoke(Native Method)

    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)

    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)"

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Anyone? Bueller? No one knows why the IAP is crashing the game? I did Request Store Listing, add products, and on Click buy Product. IDK why it's crashing. I know you need to request store listing and add product IDs before anything can be bought, and I did that.

  • Here is the code. I modified it. Will this work?

    http://imgur.com/a/P29k8

  • No one knows what's going on? The game just crashes. If the Cranberry IAP plugin is broken is there another IAP plugin that's compatible with Construct 2?

    I do Request Store Listing and add products and it crashes. Unless i have to take out Request Store Listing and just add products.

  • I've tried multiple things and nothing is worked. Even with On Start of Layout > add product and request store listing with a button that all it does it Purchase ID.

    I've come to the conclusion that IAP is not possible in Construct 2. Both the IAP and Cordova Plugin are too buggy to work reliably.

  • java.lang.IllegalStateException: Can't start async operation (launchPurchaseFlow) because another async operation(refresh inventory) is in progress.

    at com.smartmobilesoftware.util.IabHelper.flagStartAsync(IabHelper.java:821)

    at com.smartmobilesoftware.util.IabHelper.launchPurchaseFlow(IabHelper.java:375)

    at com.smartmobilesoftware.util.IabHelper.launchPurchaseFlow(IabHelper.java:340)

    at jp.wizcorp.phonegap.plugin.wizPurchase.IAP.buy(IAP.java:348)

    at jp.wizcorp.phonegap.plugin.wizPurchase.IAP.access$200(IAP.java:43)

    at jp.wizcorp.phonegap.plugin.wizPurchase.IAP$3.run(IAP.java:326)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)

    at java.lang.Thread.run(Thread.java:818)

  • it's your code.

  • I know im being a pain in the ** im sorry. i know i am. Now i find out that with Google play there is no way to refund a one-time purchase, you have to set up as consume OR wait 14 days...... so the problem with the most recent one where the button click wasn't working for Buy could be google play ><

    Turns out if you have a 1 time purchase through Google Play, there is no way to cancel to test it. As of June of last year. So someone could be testing the buy button in their app, having bought it once, and have the test purchase still active.

    The way around that is to consume the product. I'm going to try a test button that consumes the product so i can buy it again to test.

  • http://stackoverflow.com/questions/3813 ... ne-20-2016

    That's on Google, for making it more difficult to test. I know you have to cancel a test purchase before you can test purchase again. I went to my merchant screen but didn't see the test purchase, so when that one time i tested the app with the button only buy, i was confused when nothing worked. The button that only does buy product ID, nothing was happening i think because i had already purchased the test product ><

    WTB Google bringing back the ability to cancel test purchases from merch, console.

  • It works! I tested it without Internet on till I got to the button to buy, and it still works!

    With google play, you need to set up a Consume product ID. I did it with a button that on click Consume product ID. I also set up a text box that said DING (yes, ding in all caps) to made sure it worked. I had it so on Consume Product ID success, set text box with DING to visible (the box invisible to start with.)

    To make sure it worked, i temporarily set on purchase ID succeed to set text box to visible It worked multiple times. I would do a test buy, click to consume product. After I did that, I was able to buy the product ID in a test purchase.

    Google play doesn't let developers cancel test purchases from the dev. console. So i set up a Consume Product so i could keep testing it.

  • Man, one more thing. Even two. First, I found out that in CordovaIAP the "Request store lising" is always failed. However, I also found that this request, in general, is not needed. Throw it out, and replace it with "Restore purchases." The second point: exclude the possibility of simultaneous execution of two or more actions of this plugin, otherwise there will be crashes.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)