gpt4 book ai didi

android - 在 App Billing v3 IllegalArgumentException 中使用 IabHelper

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:51:24 28 4
gpt4 key购买 nike

我已经在我的应用中实现应用计费 v3 大约一周了。我使用了很多android的示例代码来简化集成。我经常记录我似乎无法重现的崩溃:

Exception Type: java.lang.RuntimeException
Reason: Unable to destroy activity {[package].billing.BillingActivity}: java.lang.IllegalArgumentException: Service not registered: [package].billing.util.IabHelper$1@40646a70

它似乎在这条线上中断了:

if (mContext != null) mContext.unbindService(mServiceConn);

我在我的 onCreate 方法中绑定(bind)此服务,并在我的 onDestroy 方法中处理它(这是记录此错误的地方)。有什么指点吗?

最佳答案

您可以替换您提到的行:

if (mContext != null) mContext.unbindService(mServiceConn);

通过这条线

if (mContext != null && mService != null) mContext.unbindService(mServiceConn);

这应该可以解决问题

关于android - 在 App Billing v3 IllegalArgumentException 中使用 IabHelper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16222015/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com