When attempting to launch billing for an in-app item, I am getting the following error.
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
The code is simple. The user selects an item. I then pass that item into querySkuDetailsAsync. I get and see the result. For API reasons, I then call...
SkuDetails skuDetails = new SkuDetails(skuDetails.getOriginalJSON());
BillingFlowParams flowParams = BillingFlowParams.newBuilder().setSkuDetails(skuDetails).build();
BillingResult billingResult = client.launchBillingFlow(activity, flowParams);
And then, most of the time, I get the NPE. Things were working fine. I don't know what change caused this issue.
Note that I did try passing the skuDetails directly, in case JSON was the issue. It didn't work.
The billing library isn't open source, so I am at a loss as to how to solve this issue.
SkuDetails
instances directly that I got fromquerySkuDetails
. Can you post the complete stack trace? – Wellspring