Android的应用内结算:定制的SKU购买给人"错误 - 没有找到"给人、没有找到、错误、Android

2023-09-05 09:55:51 作者:孤笛

我想用我自己的SKU /产品IDupgrade_to_ premium来测试应用内结算。正如我所看到的在这里推荐的,我现在用的是地下城示例应用程序。我添加了一个新的CatalogEntry(upgrade_to_ premium,R.string.upgrade_to_ premium,Managed.MANAGED)在Dungeons.java的CatalogEntry []数组。在Const.java,DEBUG设置为TRUE

I'm trying to test in-app billing using my own sku/product ID "upgrade_to_premium". As I have seen recommended here, I am using the Dungeons sample app. I've added a "new CatalogEntry("upgrade_to_premium", R.string.upgrade_to_premium, Managed.MANAGED)" to the CatalogEntry[] array in Dungeons.java. In Const.java, DEBUG is set to TRUE.

我已经上传我的版本签名.apk文件到我的开发者控制台并激活它,并安装了同样的apk我与亚行的设备。

I have uploaded my release-signed .apk to my Developer Console and activated it, and installed this same .apk to my device with adb.

我已经进入了应用程序内的产品在开发控制台相同的名字,并将其发布。

I have entered an in-app product of the same name in the Dev Console, and published it.

我登录到我的手机上有我的开发者账户,但与我的开发者控制台注册​​测试谷歌帐户。此帐户相关联的信用卡信息;我能买到的音乐吧。

I am logged into my phone not with my developer account but with a test Google account registered with my Developer Console. This account has associated credit card information; I am able to buy music with it.

我的设备运行姜饼,用最新的谷歌播放的升级。

My device is running Gingerbread, with the latest Google Play upgrade.

在开始我的手机上新安装的应用程序,我观察LogCat中预期的RestoreTransactions打电话,但它返回RESULT_DEVELOPER_ERROR。 (不是一个良好的开端?我想不是,但五个不同的文件的可能原因这个错误不适用于此,谁知道有多少无证有)。然后我尝试购买我的自定义SKU upgrade_to_ premium,但我陆续收到标题为错误消息找不到项目警告对话框,两次,只是当它通常会显示市场(播放)UI与签证信息的时间。有趣的是,我想包含无效(即未公布)包名称的市场URL时,观察到类似的错误。那是我上传的东西不被发现的未公布的草案?是我的自定义SKU没有被发现?很难从模糊的错误信息,告诉。任何人有任何线索?谢谢你。

Upon starting the newly-installed application on my phone, I observe in LogCat the expected RestoreTransactions call, but it returns RESULT_DEVELOPER_ERROR. (Not a good start? I suppose not, but the five different documented possible causes for this error do not apply here, and who knows how many undocumented there are.) Then I try to purchase my custom sku upgrade_to_premium, but I get an alert dialog entitled "Error" with the message "Item not found", twice in succession, just about the time when it normally would be displaying the Market (Play) UI with VISA info. Interestingly, I observe a similar error when trying a Market URL containing an invalid (i.e. unpublished) package name. Is the unpublished draft that I uploaded what is not being found? Is my custom sku not being found? It's hard to tell from the vague error messages. Anyone have any clues? Thanks.

下面是LogCat中输出:

Here's the LogCat output:

06-13 00:08:31.858: D/Finsky(589): [1] 5.onFinished: Installation state replication    succeeded.
06-13 00:08:43.729: I/ActivityManager(109): Starting: Intent {  act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000  cmp=com.augmentedmind.dungeons/.Dungeons } from pid 196
6-13 00:08:43.795: I/ActivityManager(109): Start proc com.augmentedmind.dungeons for activity com.augmentedmind.dungeons/.Dungeons: pid=1247 uid=10054 gids={}
06-13 00:08:44.198: D/BillingService(1247): CheckBillingSupported
06-13 00:08:44.198: I/BillingService(1247): binding to Market billing service
06-13 00:08:44.213: D/BillingService(1247): CheckBillingSupported
06-13 00:08:44.213: I/BillingService(1247): binding to Market billing service
06-13 00:08:44.221: D/BillingService(1247): Billing service connected
06-13 00:08:44.225: D/BillingService(1247): CheckBillingSupported
06-13 00:08:44.237: D/Finsky(589): [26] MarketBillingService.getPreferredAccount:  com.augmentedmind.dungeons: Account from first account.
06-13 00:08:44.241: I/BillingService(1247): CheckBillingSupported response code: RESULT_OK
06-13 00:08:44.241: I/Dungeons(1247): supported: true
06-13 00:08:44.241: D/BillingService(1247): RestoreTransactions
06-13 00:08:44.245: D/Finsky(589): [8] MarketBillingService.getPreferredAccount: com.augmentedmind.dungeons: Account from first account.
06-13 00:08:44.249: D/Finsky(589): [8] MarketBillingService.getPreferredAccount: com.augmentedmind.dungeons: Account from first account.
06-13 00:08:44.260: I/ElegantRequestDirector(589): I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
06-13 00:08:44.260: E/BillingService(1247): restoreTransactions received RESULT_OK
06-13 00:08:44.260: D/BillingService(1247): request id: 2247584787757221561
06-13 00:08:44.260: I/ElegantRequestDirector(589): Retrying request
06-13 00:08:44.268: D/BillingService(1247): request id: -1
06-13 00:08:44.268: D/BillingService(1247): CheckBillingSupported
06-13 00:08:44.272: D/Finsky(589): [7] MarketBillingService.getPreferredAccount: com.augmentedmind.dungeons: Account from first account.
06-13 00:08:44.272: I/BillingService(1247): CheckBillingSupported response code: RESULT_OK
06-13 00:08:44.272: I/Dungeons(1247): supported: true
06-13 00:08:44.272: D/BillingService(1247): request id: -1
06-13 00:08:44.346: I/ActivityManager(109): Displayed com.augmentedmind.dungeons/.Dungeons: +556ms
06-13 00:08:44.729: D/Finsky(589): [1] MarketBillingService.sendResponseCode: Sending response RESULT_DEVELOPER_ERROR for request 2247584787757221561 to com.augmentedmind.dungeons.
06-13 00:08:44.741: I/BillingService(1247): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
06-13 00:08:44.741: D/BillingService(1247): RestoreTransactions: RESULT_DEVELOPER_ERROR
06-13 00:08:44.741: D/Dungeons(1247): RestoreTransactions error: RESULT_DEVELOPER_ERROR
06-13 00:09:28.049: D/Dungeons(1247): buying: Upgrade app to premium sku: upgrade_to_premium
06-13 00:09:28.053: D/BillingService(1247): RequestPurchase
06-13 00:09:28.092: D/Finsky(589): [26] MarketBillingService.getPreferredAccount: com.augmentedmind.dungeons: Account from first account.
06-13 00:09:28.096: D/Finsky(589): [26] MarketBillingService.getPreferredAccount: com.augmentedmind.dungeons: Account from first account.
06-13 00:09:28.100: I/ActivityManager(109): Starting: Intent { act=android.intent.action.VIEW cmp=com.android.vending/com.google.android.finsky.activities.IabActivity (has extras) } from pid -1
06-13 00:09:28.104: D/BillingService(1247): request id: 137676918944123250
06-13 00:09:28.104: D/BillingService(1247): RequestPurchase
06-13 00:09:28.108: D/Finsky(589): [27] MarketBillingService.getPreferredAccount: com.augmentedmind.dungeons: Account from first account.
06-13 00:09:28.112: D/Finsky(589): [27] MarketBillingService.getPreferredAccount: com.augmentedmind.dungeons: Account from first account.
06-13 00:09:28.112: I/ActivityManager(109): Starting: Intent { act=android.intent.action.VIEW cmp=com.android.vending/com.google.android.finsky.activities.IabActivity (has extras) } from pid -1
06-13 00:09:28.116: D/BillingService(1247): request id: 5138873787070031749
06-13 00:09:28.174: D/Finsky(589): [1] SelfUpdateScheduler.checkForSelfUpdate: Skipping self-update. Local Version [8011019] >= Server Version [0]
06-13 00:09:28.381: I/ActivityManager(109): Displayed com.android.vending/com.google.android.finsky.activities.IabActivity: +262ms
06-13 00:09:28.413: E/Volley(589): [13] BasicNetwork.performRequest: Unexpected response code 500 for https://android.clients.google.com/fdfe/details?doc=subs:com.augmentedmind.dungeons:upgrade_to_premium
06-13 00:09:41.670: W/InputManagerService(109): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40796830
06-13 00:09:41.737: D/Finsky(589): [1] SelfUpdateScheduler.checkForSelfUpdate: Skipping self-update. Local Version [8011019] >= Server Version [0]

在这段时间,我得到了题为错误消息找不到项目在设备屏幕上弹出一个对话框,两次。只是当它通常会显示市场(播放)UI与签证信息所需的时间。

around this time I get a popup dialog on the device screen entitled "Error" with the message "Item not found", twice. Just about the time when it normally would be displaying the Market (Play) UI with VISA info.

06-13 00:09:41.881: D/Finsky(589): [1] MarketBillingService.sendResponseCode: Sending response RESULT_ERROR for request 5138873787070031749 to com.augmentedmind.dungeons.
06-13 00:09:41.889: I/BillingService(1247): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
06-13 00:09:41.889: D/BillingService(1247): RequestPurchase: RESULT_ERROR
06-13 00:09:41.893: D/Finsky(589): [1] PendingNotificationsService.setMarketAlarm: Setting alarm for account=tester.android30@gmail.com, duration=120000
06-13 00:09:41.940: I/ActivityManager(109): Displayed com.android.vending/com.google.android.finsky.activities.IabActivity: +271ms
06-13 00:09:41.991: E/Volley(589): [14] BasicNetwork.performRequest: Unexpected response code 500 for https://android.clients.google.com/fdfe/details?doc=inapp:com.augmentedmind.dungeons:upgrade_to_premium
06-13 00:09:45.600: W/InputManagerService(109): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@407daea0
06-13 00:09:45.682: D/Finsky(589): [1] MarketBillingService.sendResponseCode: Sending response RESULT_ERROR for request 137676918944123250 to com.augmentedmind.dungeons.
06-13 00:09:45.690: D/Finsky(589): [1] PendingNotificationsService.setMarketAlarm: Setting alarm for account=tester.android30@gmail.com, duration=120000
06-13 00:09:45.698: I/BillingService(1247): handleCommand() action:       com.android.vending.billing.RESPONSE_CODE
06-13 00:09:45.698: D/BillingService(1247): RequestPurchase: RESULT_ERROR
06-13 00:09:45.698: D/Dungeons(1247): upgrade_to_premium: RESULT_ERROR
06-13 00:09:45.698: I/Dungeons(1247): purchase failed

P.S。我读的地方,一个可能需要等待一小时左右它得到激活,但我真诚地希望这不是未发表的上传草案的情况下!为什么这类上传,这是任何用户都不会看到的,会受到延迟? ...我开始认为这是真的,因为反复上传/删除/重新上传这个的未发布应用程序草案的我刚才打的上传限额。由于痛苦在应用内计费是掌握的,我并不需要额外的烦恼。不好,谷歌。

P.S. I read somewhere that one "might have to wait an hour or so for it to get activated" but I sincerely hope this is not the case for unpublished draft uploads! Why would this sort of upload, which no user will ever see, be subject to a delay? ...I am starting to think that this is true, as by repeated upload/delete/re-upload of this unpublished draft app I have just hit an upload quota. As painful as in-app billing is to master, I don't need that extra annoyance. Not good, Google.

推荐答案

您要发布的产品(而不是应用程序)这个工作。是的,你需要稍等一下。 presumably而你的APK的状态被复制到所有谷歌播放服务器。它用于上班,大约一年前,但这种情况并非如此了。但是,你不需要上传和测试的相同的APK 的,只有版本和签名需要匹配。所以,当你开始开发一个新的版本,只是磕碰在清单,出口的版本并上传签名的APK。让它坐在那里,而你开发和测试。然后,它与你的最终的二进制发布时更换。

You have to publish the product (not the app) for this to work. And yes, you need to wait a bit. Presumably while your APK's state is replicated to all Google Play servers. It used to work right away about a year ago, but this is not the case any more. However, you don't need to upload and test the same APK, only the version and signature need to match. So, when you begin developing a new version, just bump the version in the manifest, export and upload a signed APK. Let it sit there while you develop and test. Then replace it with your final binary when publishing.