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);
}
当我执行上面的代码时,似乎我的Google Play服务会停止运行(崩溃?)
这在几天前还能工作。但现在已经停止了。
你们知道我可以做什么吗?当我使用真实的产品和测试用户进行测试时,一切仍然正常。
下面是添加的堆栈跟踪。看起来它来自Google Play商店本身。
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)