当我试图运行我的应用程序内计费我得到的错误:“这个版本的应用程序没有配置通过谷歌播放计费。查看帮助中心获取更多信息”。

我已经在Manifest文件中有计费权限,我有一个签名的。apk作为草稿上传到谷歌Play上,我也已经在我的手机上安装了相同的签名apk。

有什么帮助可以解决这个问题吗?


啊,经过几个小时的尝试,终于找到了解决方案。

谷歌需要一段时间来处理应用程序并将它们更新到服务器,对我来说大约需要半天。因此,在谷歌Play上以草稿形式保存apk后,你必须等待几个小时,应用内产品才能正常响应,并允许定期购买。 导出并签署APK。未签名的APK试图进行购买将得到错误。

如果你发布的版本与你在手机上测试的版本不一样,也会发生同样的情况。

例如,上传的版本是android:versionCode="1",而你在你的手机上测试的版本是android:versionCode="2"

你需要用你的实际证书签署APK。然后将其安装到测试设备上。然后您可以测试InAppBilling。如果您正在通过eclipse直接运行到设备(在调试模式下)来测试应用程序,那么您将得到这个错误。

如果你使用android.test. bought作为SKU,它会一直工作,但是在你的最终响应中不会有developerPayload。

如果你使用的是你自己的应用项目草稿,你可以一直测试,但你会被收费,所以之后你必须自己退款。

您不能使用用于谷歌游戏开发控制台的相同gmail帐户购买物品。

在我的情况下,由于安装的apk和上传到市场的apk的签名不同,我看到了相同的消息。

如果你使用的apk版本与谷歌比赛中的apk版本不同,就会发生这种情况。

这个错误可能是由几个原因引起的。

以下是谷歌IAB测试的要求列表。

先决条件:

AndroidManifest must include "com.android.vending.BILLING" permission. APK is built in release mode. APK is signed with the release certificate(s). (Important: with "App Signing by Google Play" it only works if you download directly from GooglePlayStore!) APK is uploaded to alpha/beta distribution channel (previously - as a draft) to the developer console at least once. (takes some time ~2h-24h). IAB products are published and their status set to active. Test account(s) is added in developer console.

测试要求:

测试APK的versionCode与上传到开发人员控制台的版本相同。 测试APK使用与上传到dev.console的证书相同的证书进行签名。 测试帐户(不是开发人员)-是设备上的主要帐户。(根据@MinosL的评论,主账号可能不需要) 测试帐户被选择为测试人员,并与有效的支付方式相链接。(@Kyone)

p.s.:发布证书调试:https://stackoverflow.com/a/15754187/1321401(链接为Thnx @dipp)

p.p.s.:很久以前就想列这个清单了。

@zlgdev, @Kyone, @MinosL更新

与SO和其他网站上的许多答案和评论相反,你不需要使用从谷歌Play下载到测试设备上的产品alpha/beta版本进行初步测试(alpha/beta发布过程通常要花半天时间)。你也不需要从你的开发工作室加载和重新加载一个签名的apk到你的测试设备。

You CAN debug preliminary Google Play in app billing services using the debug app as loaded from your developer studio directly to your test device via ADB. If you are experiencing errors that prevent this, likely you have done something wrong in your code. Pay especially close attention to the CASE of your SKU's (product ids) and their format (for example, if you load your APK as com.mydomain.my_product_id, be sure your try to purchase it this way - providing the same case and domain). Also, pay especially close attention to your itemType - this should be either "inapp" or "subs" for managed/unmanaged in app purchases or subscriptions, respectively.

As suggested by Chirag Patel, provided you have your billing code properly established, perform all testing using the android.test.purchased Sku (product ID) during your preliminary tests. Check for this ID throughout your billing operations to pass it through signature, token and payload checks, since this data is not provided by the Google test system. Additionally, give one of your test products this ID to test its purchase, unlock/load and presentation all the way through your schema. To CLEAR the purchase, simply consume it, passing the same Sku AND a token string formatted this way - no other fields are relevant :

    "inapp:"+appContext.getAppContext().getPackageName()+":android.test.purchased";

Once you have completed this phase of testing, move to semi-live testing with your alpha/beta product. Create a Google group (essentially a mailing list), add your test users emails to it, and add/invite this group to test your device in this phase (performed at the "APK" portion of your app's Google developer listing). Purchases will be simulated but not actually charged - however to clear and re-test the purchases, Google indicates that you must refund them from your Google wallet. THIS is the only phase of testing that requires the time-consuming process of using alpha/beta loads and test users.

我的问题是,我试图用调试检查它。密钥库,我是说在eclipse中运行它。我将它与我在alpha模式下发布的密钥存储库一起导出(在您可以测试它之前必须发布它)。把它安装在我的手机里,然后我就可以正常测试了。

如果你想调试IAB,你需要做的是:

提交到谷歌播放你的应用程序的版本与IAB的权限清单: 在谷歌播放上添加一个产品到您的应用程序:管理应用程序内计费 设置有签名的自定义调试密钥库:将Eclipse配置为使用有签名的密钥库

让我补充一下发生在我身上的事,也许能帮到别人。

这主要是由于签约。

由于我已经在Project结构中添加了签名细节,所以我认为每次运行时,都安装了期望的签名apk。但是选择了“调试”构建类型。

下面的修复为我解决了问题。

生成构建类型为“release”的签名apk。 手动安装apk。

当你在上传apk后添加了应用内购买,但你还没有在play store中发布应用(alpha, beta和产品)时,也会出现这个问题。

这基本上意味着,在你将apk发布到Play商店后(alpha, beta和成品),你必须添加应用内购买。否则你将无法购买或查询应用内购买。

我也遇到了同样的问题,在我读到DZDomi的帖子之前,问题没有解决。突然发现在谷歌开发人员控制台中有一个设置需要启用。在“In app purchases”部分,你的产品有一行,最右边是它的状态。它应该是活跃的!

这里没有提到的另一个原因是,您需要在真正的设备上进行测试。 随着模拟器变得越来越好,这是一个很容易犯的错误。

最近谷歌对他们的系统进行了更改,因为你已经上传了至少一个APK到你的控制台,你可以用你的应用程序测试你的应用内请求,使用任何版本代码/号码。

交叉参考LINK

配置gradle为调试版本签名。

android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            storeFile file("my-release-key.jks")
            storePassword "password"
            keyAlias "my-alias"
            keyPassword "password"
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.release
            ...
        }
    }
}

如果你从2018年开始在这里,你需要直接从Play Store下载APK并安装“衍生”APK。也许是因为谷歌的Play Store有一个功能“谷歌Play的应用签名”。

解决方案

在play store上传应用后请稍等,因为谷歌需要一段时间来更新应用版本。它会起作用的!

在旧的开发控制台:

设置->帐户详细信息->许可证测试-> Gmail具有测试访问权限的帐户,并在这里键入您的帐户

在新的开发控制台:

输入您的Gmail帐户,点击“Enter”,然后点击“Save”。

2021年结论

对于所有关心调试的人,您可以在调试模式下运行、调试和测试代码

下面是你如何测试这个过程:

(当然,这取决于您已经添加并激活了您的产品,并且您的代码已经准备好与这些产品集成)

将com.android. selling . billing添加到清单中 上传签名apk到内部测试 添加许可证测试员(播放控制台->设置->许可证测试)-如果你在你的设备上使用多个帐户,你不确定使用哪一个,只需将它们都添加为测试员。 像往常一样,从Android Studio运行应用程序(*应用程序应该具有与您刚刚上载到内部测试的应用程序相同的版本代码)

我做了上面的事情,它工作得很好。

如果你想集成另一个没有发布的应用程序,但与已部署的应用程序具有相同的id、版本代码和版本名,那么不要忘记编辑appname。iml文件版本在扑动应用程序,因为我坚持它与相同的错误。

如果所有的设置都是OK的,你仍然得到错误的应用程序的这个版本没有配置通过谷歌播放计费。查看帮助中心获取更多信息。

在Play Store中编辑您的应用内产品定价或停用并激活应用内产品。这将解决问题。

2022答:

这是测试调试/发布版本&如果应用程序是由Play签名(这意味着从谷歌Play交付的应用程序的签名证书与使用Android Studio从您的机器安装应用程序时的证书不同)。

检查以下步骤:

Create your product on Google Play Console and activate it. Add license testers (open the Google Play Console -> Settings -> License Testing). Add all the Google accounts listed on your android device. Upload signed app to the internal testing track (it must be in release mode). Use the testing link to check if the app is available to download (make sure the uploaded app version to the internal track matches the version you're testing in debug mode). It takes some time to see the latest uploaded version there, so I recommend clearing the cache of the Play Store app. Run your app in debug mode from Android Studio. (Again, the app version and build number must match the values on the published version to the internal track).

我在两个不同的谷歌Play Console帐户(两个不同的应用程序)上进行了测试,它是有效的。