android 无法在LG Nexus 5X上执行计费

mnemlml8  于 2023-02-02  发布在  Android
关注(0)|答案(1)|浏览(153)

我的应用具有应用内购买功能。我使用计费库:

def billing_version = "4.1.0"
implementation("com.android.billingclient:billing:$billing_version")
implementation("com.android.billingclient:billing-ktx:$billing_version")

我在Firebase中观察到,LG Nexus 5X(Android 8.1)的用户无法购买。他尝试了几次,但得到同样的问题

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{studio.yatoo.calendarwidget/com.android.billingclient.api.ProxyBillingActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.IntentSender android.app.PendingIntent.getIntentSender()' on a null object reference
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
   at android.app.ActivityThread.-wrap11()
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loop(Looper.java:164)
   at android.app.ActivityThread.main(ActivityThread.java:6494)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.IntentSender android.app.PendingIntent.getIntentSender()' on a null object reference
   at com.android.billingclient.api.ProxyBillingActivity.onCreate(com.android.billingclient:billing@@4.1.0:11)
   at android.app.Activity.performCreate(Activity.java:7009)
   at android.app.Activity.performCreate(Activity.java:7000)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
   at android.app.ActivityThread.-wrap11()
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loop(Looper.java:164)
   at android.app.ActivityThread.main(ActivityThread.java:6494)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

所有其他用户都没有这个问题。只有LG Nexus 5X的用户。有人能帮忙吗,如何解决这个问题?

luaexgnf

luaexgnf1#

正如我在问题下方的评论中所说的,我觉得这个问题可以忽略不计。我的应用程序相对来说是小众的,使用这么旧的设备和这个操作系统版本的人这么快就购买的可能性几乎为零。我希望谷歌能更明确地说明他们的自动测试设备,因为我以前浪费了时间去寻找类似的、看似不可能的错误。但这闻起来像是可以安全地忽略(小心)。

相关问题