Android应用内结算:自定义sku购买提供"错误 - 未找到商品"

Joh*_*mer 2 android in-app-purchase in-app-billing

我正在尝试使用自己的sku /产品ID"upgrade_to_premium"来测试应用内结算.正如我在这里看到的推荐,我正在使用Dungeons示例应用程序.我已将"new CatalogEntry("upgrade_to_premium",R.string.upgrade_to_premium,Managed.MANAGED)"添加到Dungeons.java中的CatalogEntry []数组中.在Const.java中,DEBUG设置为TRUE.

我已将发布已签名的.apk上传到我的开发者控制台并激活它,并使用adb将此相同的.apk安装到我的设备上.

我在开发者控制台中输入了同名的应用内商品,并将其发布.

我没有使用我的开发者帐户登录到手机,而是使用我的开发者控制台注册了测试Google帐户.此帐户具有相关的信用卡信息; 我可以用它买音乐.

我的设备运行Gingerbread,最新的Google Play升级.

在我的手机上启动新安装的应用程序后,我在LogCat中观察到预期的RestoreTransactions调用,但它返回RESULT_DEVELOPER_ERROR.(不是一个好的开始?我想不是,但是这个错误的五个不同记录的可能原因在这里不适用,谁知道有多少没有文档.)然后我尝试购买我的自定义sku upgrade_to_premium,但我收到警报标题为"错误"的对话框,带有"未找到项目"的消息,连续两次,大约是通常显示带有签证信息的市场(播放)用户界面的时间.有趣的是,我在尝试包含无效(即未发布)包名称的市场URL时发现了类似的错误.我上传的未发布的草稿是未找到的吗?我的自定义sku没被找到吗?从模糊的错误消息中很难说清楚.有人有任何线索吗?谢谢.

这是LogCat输出:

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]
Run Code Online (Sandbox Code Playgroud)

大约在这个时候,我在设备屏幕上看到一个名为"Error"的弹出对话框,其中显示消息"Item not found",两次.几乎是通常会显示带有VISA信息的市场(Play)UI的时间.

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
Run Code Online (Sandbox Code Playgroud)

PS我读到某个地方"可能需要等待一个小时才能激活它"但我真诚地希望未发布的草稿上传不是这样的!为什么这种上传,没有用户会看到,会受到延迟?...我开始认为这是真的,因为通过重复上传/删除/重新上传这个未发布的草稿应用程序,我刚刚达到上传配额.尽管掌握了应用内结算的痛苦,但我并不需要额外的烦恼.不好,谷歌.

Nik*_*kov 9

您必须发布产品(而非应用程序)才能使用此功能.是的,你需要等一下.据推测,当您的APK状态被复制到所有Google Play服务器时.它曾经在大约一年前马上工作,但事实并非如此.但是,您不需要上传和测试相同的APK,只需要匹配版本和签名.因此,当您开始开发新版本时,只需在清单中修改版本,导出并上传已签名的APK.在你开发和测试时让它坐在那里.然后在发布时将其替换为最终二进制文件.