10
Bundle buyIntentBundle = inappService.getBuyIntent(3, this.getPackageName(), "android.test.purchased", "inapp", "myUserId");
int responseCode = buyIntentBundle.getInt("RESPONSE_CODE");
if (responseCode == 0) {
   PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
   this.startIntentSenderForResult(pendingIntent.getIntentSender(), PURCHASE_REQUEST_CODE, new Intent(), 0, 0, 0);
}

It appears that right when i execute the code above, my google play service will stop running (crash?)

This used to work about couple days ago. But now it has stopped.

Do you guys know what I can do? When I tested with a real product with beta testing users everything still works.

Here is the added stack trace. Looks like it comes from Google Play Store itself.

    07-21 14:28:51.172 18056-18224/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
                                                       Process: com.android.vending, PID: 18056
                                                       java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:318)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.NullPointerException: Attempt to read from field 'long com.google.wireless.android.finsky.dfe.nano.an.b' on a null object reference
at com.google.android.finsky.billing.lightpurchase.s.a(SourceFile:5)
at com.google.android.finsky.billing.lightpurchase.h.doInBackground(SourceFile:27)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
at java.lang.Thread.run(Thread.java:762) 
fdelafuente
  • 1,114
  • 1
  • 13
  • 24
Zhen Liu
  • 7,550
  • 14
  • 53
  • 96
  • 1
    Yes i have same problem nowadays. It was working one week ago. But today the app is crashing. I did't found any solution like update google play or etc :/ – MarsPeople Jul 22 '17 at 11:49
  • I have also same problem. I have tested on 2 device but no luck. Is anybody found solution then please post here – Harin Kaklotar Jul 27 '17 at 06:58
  • @HarinKaklotar i think we should just wait for "google play store" update for fix the "play store app crash" problem. – MarsPeople Jul 27 '17 at 08:04
  • @MarsPeople I test my app in huwai tablet and nexus tablet. but in both I crash the google play store ;) – Harin Kaklotar Jul 27 '17 at 08:08
  • 1
    @Harin Kaklotar yes i think it is not related to "phone model", it's "play store" bug, i tested in s7, s3 mini, play store always crashing when i buy "android.test.purchased" – MarsPeople Jul 27 '17 at 08:55
  • I am also having the same issue, it was working fine with any SKU in the last week but since then, the playstore keeps crashing giving me this same exact error message. I tested this code on Nexus 5 and Samsung s6 edge and HTC, crashes in all giving the same exact stack trace. – theanilpaudel Jul 27 '17 at 11:08

2 Answers2

9

I contacted with Google Developer Support and they said it's "Google Play Store bug"

Google Reply:

We are aware of this issue, and our engineers are currently investigating it. I will provide more updates as soon as I get any information from them.

So there is no need to do anything about this crash. Just wait for bug fixes on Google Play Store App.


EDIT(08.08.2017)

Today the "android.test.purchased" crash problem fixed. The Google Play Store App version is 8.0.73.R-all [0] [PR] 162689464 now.

MarsPeople
  • 1,772
  • 18
  • 30
1

As per @MarsPeople said on comment It's because of google play store's new update (version 8.0.26.R-all [0] [PR] 161173660). I tested(in app billing) around 3-4 device which contain this google play store version so in that device google play store crash and get nullpointer exception, but When I uninstall the update and test it with older version (like in my case version 5.1.11) it work perfectly but after some time play store update forcefully (version 8.0.26.R-all [0] [PR] 161173660) and then I tried it then google play store crash. So yes we have to wait until google give new update on this issue :)

but surprisingly it work perfectly with real SKU which is provided from google console. and not work with test SKU (android.test.purchased)

I hope this will help someone who get this issue on google play store version 8.0.26.R-all [0] [PR] 161173660

Harin Kaklotar
  • 305
  • 7
  • 22
  • 1
    I sent an email to google developer support about this bug. And if we use "real SKU" then we should always signature the apk for every code changes and it is very waste of time :/ we want "android.test.purchased" back! :) – MarsPeople Jul 27 '17 at 12:36