Android 此版本的应用程序未配置为通过 Google Play 计费
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11068686/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
This version of the application is not configured for billing through Google Play
提问by Gatekeeper
When I try to run my application with in-app billing I am getting the error: "This version of the application is not configured for billing through Google Play. Check the help center for more information".
当我尝试使用应用内计费运行我的应用程序时,我收到错误消息:“此版本的应用程序未配置为通过 Google Play 计费。查看帮助中心了解更多信息”。
I have the billing permission already in the Manifest file and I have a signed .apk uploaded as a draft onto Google Play and I have also installed that same signed apk onto my phone.
我已经在 Manifest 文件中获得了计费许可,并且我已将签名的 .apk 作为草稿上传到 Google Play,并且我还在我的手机上安装了相同的签名 apk。
Any help on how to solve this issue?
有关如何解决此问题的任何帮助?
采纳答案by Gatekeeper
Ahh found the solution after trying for a couple of hours.
Ahh 尝试了几个小时后找到了解决方案。
- Google takes a while to process applications and update them to their servers, for me it takes about half a day. So after saving the apk as a draft on Google Play, you must wait a few hours before the in-app products will respond normally and allow for regular purchases.
- Export and sign APK. Unsigned APK trying to make purchases will get error.
- 谷歌需要一段时间来处理应用程序并将它们更新到他们的服务器,对我来说大约需要半天时间。因此,在将 apk 保存为 Google Play 上的草稿后,您必须等待几个小时,应用内产品才能正常响应并允许定期购买。
- 导出并签署 APK。尝试进行购买的未签名 APK 会出错。
回答by Luten
This error may be caused by several reasons.
此错误可能由多种原因引起。
Here is the list of requirements for the Google IAB testing.
以下是 Google IAB 测试的要求列表。
Prerequisites:
先决条件:
- AndroidManifest must include "com.android.vending.BILLING" permission.
- APK is built in release mode.
- APK is signedwith 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 distributionchannel (previously - as a draft) to the developer console at least once. (takes some time ~2h-24h).
- IAB products are publishedand their status set to active.
- Test account(s) is addedin developer console.
- AndroidManifest 必须包含“com.android.vending.BILLING”权限。
- APK 内置于发布模式。
- APK使用发布证书签名。(重要提示:通过“Google Play 应用签名”,它仅在您直接从 GooglePlayStore 下载时才有效!)
- APK至少一次上传到alpha/beta 分发渠道(以前 - 作为草稿)到开发者控制台。(需要一些时间~2h-24h)。
- IAB产品已发布,其状态设置为active。
- 在开发者控制台中添加了测试帐户。
Testing requirements:
测试要求:
- Test APK has the same versionCodeas the one uploaded to developer console.
- Test APK is signedwith the same certificate(s)as the one uploaded to dev.console.
- Test account(not developer) - is the main accounton the device. (Main account might be not necessary - according to @MinosLcomment)
- Test account is opted-inas a tester and it's linked to a valid payment method. (@Kyone)
- 测试 APK与上传到开发者控制台的版本代码相同。
- 测试的APK签署具有相同的证书(S)作为一个上传到dev.console。
- 测试帐户(不是开发人员)- 是设备上的主帐户。(可能不需要主帐户 - 根据@MinosL评论)
- 测试帐户已选择作为测试人员加入,并且已关联到有效的付款方式。( @Kyone)
P.S: Debugging with release certificate: https://stackoverflow.com/a/15754187/1321401(Thnx @dippfor the link)
PS:使用发布证书进行调试:https: //stackoverflow.com/a/15754187/1321401(链接的Thnx @dipp)
P.P.S: Wanted to make this list for a long time already.
PPS:想列这个清单很久了。
回答by sandalone
The same will happen if your published version is not the same as the version you're testing on your phone.
如果您发布的版本与您在手机上测试的版本不同,也会发生同样的情况。
For example, uploaded version is android:versionCode="1"
, and the version you're testing on your phone is android:versionCode="2"
例如,上传的版本是android:versionCode="1"
,您在手机上测试的版本是android:versionCode="2"
回答by Chirag Patel
You need to sign your APK with your live certificate. Then install that onto your test device. You can then test InAppBilling. If you are testing your application by direct run via eclipse to device(In debug mode) then you will get this error.
您需要使用实时证书对 APK 进行签名。然后将其安装到您的测试设备上。然后您可以测试 InAppBilling。如果您通过 eclipse 直接运行到设备(在调试模式下)来测试您的应用程序,那么您将收到此错误。
If you are using android.test.purchased
as the SKU, it will work all the way, but you won't have the developerPayload in your final response.
如果您android.test.purchased
用作 SKU,它会一直工作,但您的最终响应中不会有 developerPayload。
If you are using your own draft in app item you can test all the way but you will be charged and so will have to refund it yourself afterwards.
如果您在应用程序项目中使用自己的草稿,您可以一直测试,但您将被收费,因此之后必须自行退款。
You cannot buy items with the same gmail account that you use for the google play development console.
您不能使用用于 google play 开发控制台的相同 gmail 帐户购买项目。
回答by Pablo Cegarra
In the developer console:
在开发者控制台中:
Settings
-> Account details
-> License Testing
-> Gmail accounts with testing access
Settings
-> Account details
-> License Testing
-> 具有测试访问权限的 Gmail 帐户
and type here your accounts
并在此处输入您的帐户
回答by Law Gimenez
If you're here from 2018, you need to download the APK directly from Play Store and install the "derived" APK. Maybe it is because of Google's Play Store has a feature "App Signing by Google Play".
如果您从 2018 年开始使用,则需要直接从 Play 商店下载 APK 并安装“派生”APK。可能是因为 Google 的 Play 商店有一个“Google Play 应用签名”功能。
回答by Shree Harsha S
Let me just add what happened with me, may help some one.
让我补充一下发生在我身上的事情,可能会对某些人有所帮助。
It was mainly due to signing.
主要是因为签约。
Since I have added the signing details in the Project structure, I was thinking that every time when I run, expected signed apk is getting installed. But build type 'debug' was selected.
由于我在项目结构中添加了签名详细信息,我在想每次运行时,都会安装预期的签名 apk。但是选择了构建类型“调试”。
Below fix solved the problem for me.
下面的修复为我解决了这个问题。
- Generated signed apk of build type 'release'.
- Manually installed the apk.
- 生成构建类型“发布”的签名 apk。
- 手动安装apk。
回答by Amalka
This will happen if you use a different version of the apk than the one in the google play.
如果您使用的 apk 版本与 google play 中的版本不同,则会发生这种情况。
回答by Epsilon3
Contrary to many answers and comments on SO and other sites, you do NOT have to perform preliminary tests with an alpha/beta version of your product that has been downloaded from Google Play onto your test device (the alpha/beta publication process often eats up half a day). Neither do you have to load and re-load a signed release apk from your developer studio to your test device.
与 SO 和其他网站上的许多答案和评论相反,您不必对从 Google 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.
您可以使用从开发人员工作室直接通过 ADB 加载到测试设备的调试应用程序,在应用程序计费服务中调试 Google Play 初步。如果您遇到阻止此操作的错误,则可能是您在代码中做错了。请特别注意 SKU 的大小写(产品 ID)及其格式(例如,如果您将 APK 加载为 com.mydomain.my_product_id,请确保尝试以这种方式购买它 - 提供相同的大小写和域) . 此外,请特别注意您的 itemType - 对于托管/非托管应用内购买或订阅,这应该分别是“inapp”或“subs”。
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 :
正如 Chirag Patel 所建议的那样,如果您正确建立了计费代码,请在初步测试期间使用 android.test.purchased Sku(产品 ID)执行所有测试。在整个结算操作中检查此 ID 以通过签名、令牌和有效负载检查,因为 Google 测试系统不提供此数据。此外,为您的测试产品之一提供此 ID,以在整个架构中测试其购买、解锁/加载和展示。要清除购买,只需使用它,传递相同的 Sku 和以这种方式格式化的令牌字符串 - 没有其他字段相关:
"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.
完成此测试阶段后,请使用您的 alpha/beta 产品进行半实时测试。创建一个 Google 群组(本质上是一个邮件列表),向其中添加您的测试用户电子邮件,并添加/邀请该群组在此阶段测试您的设备(在您应用的 Google 开发者列表的“APK”部分执行)。购买将被模拟但不会实际收费 - 但是为了清除和重新测试购买,Google 指示您必须从您的 Google 钱包中退款。这是唯一需要使用 alpha/beta 负载和测试用户的耗时过程的测试阶段。
回答by goRGon
In my case I saw the same message due to the different signatures of the installed apk and an uploaded to the market apk.
就我而言,由于安装的 apk 和上传到市场的 apk 的签名不同,我看到了相同的消息。