【问题标题】:CheckoutPurchase.setError: type=UNKNOWN, code =-1, message = Error Processing Purchase [DF-BPA-13]CheckoutPurchase.setError: type=UNKNOWN, code =-1, message = Error Processing Purchase [DF-BPA-13]
【发布时间】:2012-10-12 12:56:27
【问题描述】:

所以我正在使用 android 计费库并进行了这个小设置:

    BillingController.setConfiguration(new BillingController.IConfiguration() {

                    public byte[] getObfuscationSalt() {
//Havent changed this
                        return new byte[] { 41, -90, -116, -41, 66, -53, 122,
                                -110, -127, -96, -88, 77, 127, 115, 1, 73, 57,
                                110, 48, -116 };
                    }

                    public String getPublicKey() {
                        return "The key (yes this is set correctly)";
                    }
                });

        BillingController.setDebug(true);

        mBillingObserver = new AbstractBillingObserver(this) {

            public void onBillingChecked(boolean supported) {
                BuyCoins.this.onBillingChecked(supported);
            }

            public void onPurchaseStateChanged(String itemId,
                    PurchaseState state) {
                BuyCoins.this.onPurchaseStateChanged(itemId, state);
            }

            public void onRequestPurchaseResponse(String itemId,
                    ResponseCode response) {
                BuyCoins.this.onRequestPurchaseResponse(itemId,
                        response);
            }

            public void onSubscriptionChecked(boolean supported) {
                BuyCoins.this.onSubscriptionChecked(supported);
            }

        };

        BillingController.registerObserver(mBillingObserver);
        BillingController.checkBillingSupported(this);
        BillingController.checkSubscriptionSupported(this);

    }

然后简单地说:

public void onSubscriptionChecked(boolean supported) {
    if (supported) {
        Toast.makeText(this, "Subscription is supported", Toast.LENGTH_SHORT)
                .show();
    } else {
        Toast.makeText(this, "Subscription is NOT supported", Toast.LENGTH_SHORT)
                .show();

    }
}

public void onRequestPurchaseResponse(String itemId, ResponseCode response) {
    if (response == ResponseCode.RESULT_OK) {
        Toast.makeText(this, "Purchase Response OK", Toast.LENGTH_LONG)
                .show();
    } else if (response == ResponseCode.RESULT_USER_CANCELED) {
        Toast.makeText(this, "Purchase Response Canceled",
                Toast.LENGTH_LONG).show();
    } else if (response == ResponseCode.RESULT_SERVICE_UNAVAILABLE) {
        Toast.makeText(this, "Purchase Response Unavailable",
                Toast.LENGTH_LONG).show();
    } else if (response == ResponseCode.RESULT_ERROR) {
        Toast.makeText(this, "Purchase Response Error", Toast.LENGTH_LONG)
                .show();
    } else {
        Toast.makeText(this, "UNKNOWN RESPONSE", Toast.LENGTH_LONG)
        .show();        }
}

public void onPurchaseStateChanged(String itemId, PurchaseState state) {
    Toast.makeText(this,
            "Purchase State: " + state.toString() + " for item " + itemId,
            Toast.LENGTH_LONG).show();

    purchaseList();
}

public void onBillingChecked(boolean supported) {
    if (supported) {
        Toast.makeText(this, "Billing is supported", Toast.LENGTH_SHORT)
                .show();
    } else {
        Toast.makeText(this, "Billing is NOT supported", Toast.LENGTH_SHORT)
                .show();

    }
}

并且该项目被调用:

public void onClick(View v) {

    switch (v.getId()) {
    case R.id.buy_coins_button_one:
        BillingController.requestPurchase(this, "coins",true /* confirm */, null);
        break;
    case R.id.buy_coins_button_two:
        BillingController.requestPurchase(this, "android.test.purchased",true /* confirm */, null);
        break;

    }

}

如果我点击按钮一(硬币),我会得到标题中提到的错误(“错误处理购买:[DF-BPA-13],然后我什至可以点击“接受并购买”

我到处检查过,似乎没有关于为什么会出现此错误的明确答案。

如果我点击按钮二(保留的 android 按钮),我可以点击购买,但随后我得到:

从服务器检索信息时出错。 [DF-DFERH-01]

所以这里有一些措施来对抗这种无稽之谈:

  • 公钥正确
  • 应用内商品已发布 1 天
  • 在计费观察器上将调试设置为 true
  • 应用已导出并使用密钥库签名,并安装了 apk
  • 测试用户不是发布用户
  • 测试用户在测试帐户列表中
  • 调试设置为关闭,但出现相同问题
  • 主要手机用户已更改(恢复出厂设置)为不同的测试用户
  • 在不同用户的不同设备上测试
  • APK 和 Market 上的版本和版本代码相同

我完全迷路了。也许值得注意的是还有另一个错误([27] 而不是 1 像其他人一样):[27] FileBasedKeyValueStore.delete: Attempt to delete 'paramsnMy695NrbaHSHjK0hNnMgg' failed!

我是否在某处遗漏了什么?这一切看起来都非常简单。

我看过:

In App Purchase Issue

[DF-BPA-13]

In-App Billing Not Working

我会及时告诉你我是如何解决的,因为这似乎是一个常规问题

编辑:因此您无法从开发控制台中删除应用程序,因此删除/添加不起作用。

【问题讨论】:

    标签: android in-app-billing


    【解决方案1】:

    哈知道了。这很奇怪。也许这是侥幸,它刚刚开始,但这对我有用:

    结果是测试帐户和发布者帐户在结帐时绑定到同一张信用卡。在测试帐户上更改它修复了它。呸呸呸。

    【讨论】:

      【解决方案2】:

      这基本上是因为 Google 需要一些时间来同步产品列表。因此,如果您对产品进行任何更改或添加新项目,然后给一些时间(1 小时左右),它将自动修复

      【讨论】:

      • 如果您阅读:“应用内商品已发布 1 天”,则根本不是问题
      猜你喜欢
      • 2019-12-14
      • 1970-01-01
      • 1970-01-01
      • 2022-12-26
      • 1970-01-01
      • 1970-01-01
      • 2022-08-22
      • 2018-07-03
      • 2018-12-04
      相关资源
      最近更新 更多