• 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 IAP's not working on Android. NullPointerException on GPBilling_PurchaseProduct

svrij22

Member
After examining this YoYoGames page about IAP's on Android I implemented the default code from the GooglePlayServices package from the marketplace.

When calling the function GPBilling_PurchaseProduct() in the Left Mouse Press Event I get this error:

Does anyone else have this error?

I have:

Set up a store presence for the game, uploaded an APK
Set up IAPs for the game on the store app console
Add the required extension to GameMaker Studio 2


05-19 23:47:55.541 21145 21245 I yoyo : Calling to purchase gems_1
05-19 23:47:55.541 21145 21245 I yoyo : InvocationTargetException thrown trying to call method GPBilling_PurchaseProduct on GooglePlayBilling
05-19 23:47:55.541 21145 21245 I yoyo : Target exception: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference. Cause: null. Stack trace:
05-19 23:47:55.541 21145 21245 I yoyo : java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
05-19 23:47:55.541 21145 21245 I yoyo : at com.svrij22.dozr2.GooglePlayBillingService.purchaseSku(GooglePlayBillingService.java:468)
05-19 23:47:55.541 21145 21245 I yoyo : at com.svrij22.dozr2.GooglePlayBillingService.purchaseCatalogItem(GooglePlayBillingService.java:500)
05-19 23:47:55.541 21145 21245 I yoyo : at com.svrij22.dozr2.GooglePlayBilling.GPBilling_PurchaseProduct(GooglePlayBilling.java:153)
05-19 23:47:55.541 21145 21245 I yoyo : at java.lang.reflect.Method.invoke(Native Method)
05-19 23:47:55.541 21145 21245 I yoyo : at com.yoyogames.runner.RunnerJNILib.CallExtensionFunction(RunnerJNILib.java:1179)
05-19 23:47:55.541 21145 21245 I yoyo : at com.yoyogames.runner.RunnerJNILib.Process(Native Method)
05-19 23:47:55.541 21145 21245 I yoyo : at com.svrij22.dozr2.DemoRenderer.onDrawFrame(DemoRenderer.java:508)
05-19 23:47:55.541 21145 21245 I yoyo : at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1582)
05-19 23:47:55.541 21145 21245 I yoyo : at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1281)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_AcknowledgePurchase(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_AddProduct(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_AddSubscription(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_ConnectToStore()
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_ConsumeProduct(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_GetStatus()
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_Init()
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_IsStoreConnected()
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_PurchaseProduct(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_PurchaseSubscription(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Purchase_GetOriginalJson(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Purchase_GetSignature(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_Purchase_GetState(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_Purchase_VerifySignature(java.lang.String,java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_QueryProducts()
05-19 23:47:55.541 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_QueryPurchases(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_QuerySubscriptions()
05-19 23:47:55.541 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetDescription(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetFreeTrialPeriod(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetIconUrl(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetIntroductoryPrice(java.lang.String)
05-19 23:47:55.541 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetIntroductoryPriceAmountMicros(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetIntroductoryPriceCycles(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetIntroductoryPricePeriod(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetOriginalJson(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetOriginalPrice(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetOriginalPriceAmountMicros(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetPrice(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetPriceAmountMicros(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetPriceCurrencyCode(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetSku(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetSubscriptionPeriod(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetTitle(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public java.lang.String com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_GetType(java.lang.String)
05-19 23:47:55.542 21145 21245 I yoyo : Found method public double com.svrij22.dozr2.GooglePlayBilling.GPBilling_Sku_IsRewarded(java.lang.String)
 

J4mie

Member
Did you ever find a solution for this? I am getting the same error on the latest GPB extension when i call ` GPBilling_PurchaseProduct`. This is on a game that is years old and has had working IAP's. Just trying to update to the new GPB code. I know the IAP is working because `GPBilling_QueryPurchasesAsync` is correctly getting the already purchased item.
 
Top