接收广播时出错 Intent act=com.android.vending.billing.PURCHASES_UPDATED

Error receiving broadcast Intent act=com.android.vending.billing.PURCHASES_UPDATED

我在 crashlytics 日志中收到错误

java.lang.RuntimeException: Error receiving broadcast Intent { act=com.android.vending.billing.PURCHASES_UPDATED flg=0x10 pkg=*** (has extras) } in com.android.billingclient.api.zzg@c300e4d android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable[=12=]$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1577) android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2) android.os.Handler.handleCallback(Handler.java:938) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loop(Looper.java:368) android.app.ActivityThread.main(ActivityThread.java:7710) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)

使用标准 Google 计费库订阅 + 应用内计费

https://developer.android.com/google/play/billing/integrate

我在文档中没有看到我应该注册广播接收器,PURCHASES_UPDATED 来自哪里?

问题是体系结构问题,计费客户端在 onCreate 中的某个基础 Activity 中初始化,并且是在少数活动中触发购买回调时的情况,其中一个在非法状态。