google 播放支付流程认证错误

google play payment flow authentication error

您好,我正在尝试测试我的应用内购买。我已经设置了一个商家帐户,并创建了一个 alpha 测试组。但是,当我尝试在我设备上的应用程序上发起付款时,我收到以下错误。我已经在 2 种不同的设备上对此进行了测试,但我得到了同样的错误,尽管我能够下载其他应用程序。

Error Authentication is required. You need to sign in to your Google Account.

请帮忙

    mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
        public void onIabSetupFinished(IabResult result) {
            Log.d(TAG, "Setup finished.");

            if (!result.isSuccess()) {
                // Oh noes, there was a problem.
                complain("Problem setting up in-app billing: " + result);
                return;
            }

            // Have we been disposed of in the meantime? If so, quit.
            if (mHelper == null) return;

            // IAB is fully set up. Now, let's get an inventory of stuff we own.
            Log.d(TAG, "Setup successful. Querying inventory.");
            try {
                mHelper.queryInventoryAsync(mGotInventoryListener);
            } catch (IabHelper.IabAsyncInProgressException e) {
                complain("Error querying inventory. Another async operation in progress.");
            }
        }
    });

   //Querying for Items Available for Purchase
   IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
    public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
        Purchase gasPurchase = inventory.getPurchase(SKU_GAS);
        if (gasPurchase != null && verifyDeveloperPayload(gasPurchase)) {
            Log.d(TAG, "We have gas. Consuming it.");
            try {
                mHelper.consumeAsync(inventory.getPurchase(SKU_GAS), mConsumeFinishedListener);
            } catch (IabHelper.IabAsyncInProgressException e) {
                complain("Error consuming gas. Another async operation in progress.");
            }
            return;
        }

        //updateUi();
        //setWaitScreen(false);
        Log.d(TAG, "Initial inventory query finished; enabling main UI.");
    }
   };

   // User clicked the "Buy Gas" button
   public void onBuyCoinButtonClicked(View arg0) {
    Log.d(TAG, "Buy coin button clicked.");

    Log.d(TAG, "Launching purchase flow for coins.");

    String payload = "";

    try {
        mHelper.launchPurchaseFlow(this, SKU_GAS, RC_REQUEST,
                mPurchaseFinishedListener, payload);
    } catch (IabHelper.IabAsyncInProgressException e) {
        complain("Error launching purchase flow. Another async operation in progress.");
        //setWaitScreen(false);
    }
}

我的来源来自简单的驱动示例 https://developer.android.com/training/in-app-billing/preparing-iab-app.html

第 1 步:检查您的 base 64 密钥

第 2 步:检查您的 Sku

static final String SKU_GAS = "android.test.purchased";