{"action":"created","issue":{"url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/131","labels_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/131/comments","events_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/131/events","html_url":"https://github.com/j3k0/cordova-plugin-purchase/issues/131","id":55419156,"number":131,"title":"Successful in-app purchase crashes the app","user":{"login":"paprikka","id":1511643,"avatar_url":"https://avatars.githubusercontent.com/u/1511643?v=3","gravatar_id":"","url":"https://api.github.com/users/paprikka","html_url":"https://github.com/paprikka","followers_url":"https://api.github.com/users/paprikka/followers","following_url":"https://api.github.com/users/paprikka/following{/other_user}","gists_url":"https://api.github.com/users/paprikka/gists{/gist_id}","starred_url":"https://api.github.com/users/paprikka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paprikka/subscriptions","organizations_url":"https://api.github.com/users/paprikka/orgs","repos_url":"https://api.github.com/users/paprikka/repos","events_url":"https://api.github.com/users/paprikka/events{/privacy}","received_events_url":"https://api.github.com/users/paprikka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-25T15:32:52Z","updated_at":"2015-06-17T15:19:05Z","closed_at":null,"body":"After a successful purchase the app crashes (stack trace attached).\r\nWe're using Cordova 3.6.3 with a Crosswalk template (crosswalk-cordova-10.39.235.15-arm).\r\n\r\nIt's a single item (non consumable) purchase. I'm using a separate test account, with real products (as opposed to static ones).\r\n\r\n```\r\nD/IabHelper(26210): Expected item type: inapp\r\nD/IabHelper(26210): Purchase signature successfully verified.\r\nD/CordovaPurchase(26210): Purchase finished: IabResult: Success (response: 0:Error), purchase: PurchaseInfo(type:inapp):{\"orderId\":\"12999763169054705758.1366267159098794\",\"packageName\":\"com.XXXXXX.XXXXXX\",\"productId\":\"com.getcontentment._test.single3\",\"purchaseTime\":1422199082804,\"purchaseState\":0,\"purchaseToken\":\"nlajeodjdkhbpcogkepedcjb.AO-J1OyO386NU3bBiABs_1EhZOEfbtslUuf9Fjlpz5V_K5-8pI9RDeOUcaAyqoAmh_seqoFzek4ZMrKIpGfO-6R6-2hTOPOALdh9UFACdfen1g-RTuz8S2v4prVt9IKRzRwrlA7NPWc5dc4-jAaDJv2ROg_FN5O4vA\"}\r\nD/CordovaPurchase(26210): Purchase successful.\r\nD/AndroidRuntime(26210): Shutting down VM\r\nE/AndroidRuntime(26210): FATAL EXCEPTION: main\r\nE/AndroidRuntime(26210): Process: com.XXXXXX.XXXXXX, PID: 26210\r\nE/AndroidRuntime(26210): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=10001, result=-1, data=Intent { (has extras) }} to activity {com.XXXXXX.XXXXXX/com.XXXXXX.XXXXXX.ApplicationName}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.smartmobilesoftware.util.Inventory.addPurchase(com.smartmobilesoftware.util.Purchase)' on a null object reference\r\nE/AndroidRuntime(26210):  at android.app.ActivityThread.deliverResults(ActivityThread.java:3351)\r\nE/AndroidRuntime(26210):  at android.app.ActivityThread.handleSendResult(ActivityThread.java:3394)\r\nE/AndroidRuntime(26210):  at android.app.ActivityThread.access$1300(ActivityThread.java:135)\r\nE/AndroidRuntime(26210):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)\r\nE/AndroidRuntime(26210):  at android.os.Handler.dispatchMessage(Handler.java:102)\r\nE/AndroidRuntime(26210):  at android.os.Looper.loop(Looper.java:136)\r\nE/AndroidRuntime(26210):  at android.app.ActivityThread.main(ActivityThread.java:5001)\r\nE/AndroidRuntime(26210):  at java.lang.reflect.Method.invoke(Native Method)\r\nE/AndroidRuntime(26210):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)\r\nE/AndroidRuntime(26210):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)\r\nE/AndroidRuntime(26210): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.smartmobilesoftware.util.Inventory.addPurchase(com.smartmobilesoftware.util.Purchase)' on a null object reference\r\nE/AndroidRuntime(26210):  at com.smartmobilesoftware.inappbilling.InAppBillingPlugin$4.onIabPurchaseFinished(InAppBillingPlugin.java:375)\r\nE/AndroidRuntime(26210):  at com.smartmobilesoftware.util.IabHelper.handleActivityResult(IabHelper.java:514)\r\nE/AndroidRuntime(26210):  at com.smartmobilesoftware.inappbilling.InAppBillingPlugin.onActivityResult(InAppBillingPlugin.java:421)\r\nE/AndroidRuntime(26210):  at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:822)\r\nE/AndroidRuntime(26210):  at android.app.Activity.dispatchActivityResult(Activity.java:5423)\r\nE/AndroidRuntime(26210):  at android.app.ActivityThread.deliverResults(ActivityThread.java:3347)\r\nE/AndroidRuntime(26210):  ... 9 more\r\n```"},"comment":{"url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/comments/112841715","html_url":"https://github.com/j3k0/cordova-plugin-purchase/issues/131#issuecomment-112841715","issue_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/131","id":112841715,"user":{"login":"quintonn","id":9988541,"avatar_url":"https://avatars.githubusercontent.com/u/9988541?v=3","gravatar_id":"","url":"https://api.github.com/users/quintonn","html_url":"https://github.com/quintonn","followers_url":"https://api.github.com/users/quintonn/followers","following_url":"https://api.github.com/users/quintonn/following{/other_user}","gists_url":"https://api.github.com/users/quintonn/gists{/gist_id}","starred_url":"https://api.github.com/users/quintonn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quintonn/subscriptions","organizations_url":"https://api.github.com/users/quintonn/orgs","repos_url":"https://api.github.com/users/quintonn/repos","events_url":"https://api.github.com/users/quintonn/events{/privacy}","received_events_url":"https://api.github.com/users/quintonn/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T15:19:05Z","updated_at":"2015-06-17T15:19:05Z","body":"I found that you have to edit the billing_key_param.xml file inside the plugin folder with your billing key. I am using Visual Studio tools for apache cordova and this fixed a similar issue i had"}}