在GFW和google拐弯抹角的文档的关照下,调试googlePlay的登录和充值花了好多时间,分享一下遇到的问题和解决方法
1.充值测试手机环境
如果能登录play store,也绑定了visa/master信用卡,但是只能见到免费游戏和APP,请寻找一个境外ip的vpn……嗯,ip是重点。
直到能看到收费项目,就可以开始测试了,在这之前,如果进行iab的初始化,大概会报
Error checking for billing v3 support
==============================================================
2.添加测试账号
登录play game services需要在这里的“添加测试人员”加入测试账号:
也可以直接加入一个群组:
充值测试需要在这里的“许可测试”加:
==============================================================
3.各种报错
================================
In-app billing error: Unable to buy item, Error response: 7:Item Already Owned
这个问题源于iab的流程:
http://developer.android.com/google/play/billing/api.html
一个商品支付完成后,需要被消费掉才能继续购买,所以参照例子在QueryInventoryFinishedListener和OnIabPurchaseFinishedListener适当的地方调用IabHelper的consumeAsync方法
================================
Error consuming response: 6:Error
加完consumeAsync我就遇到这个报错,消费失败,隐约记得这个报错是跟测试环境有关,但是搜半天搜不到解决办法,而且也无法继续测试支付了,就放着没管,时间是周五,结果周一回来打开手机居然就成功了,嗯,隐约记得上一次也好像是这样……好吧……google好像什么地方都有缓存,改个什么都得等半天才生效
================================
Can't start async operation (launchPurchaseFlow) because another async operation(launchPurchaseFlow) is in progress
这是我一次支付完成之后,想要进行第二次支付报的错,大概就是第一次的支付没有结束云云,其实就是IabHelper的状态没有改变,支付完成之后没有调flagEndAsync()这个方法,后来发现是粗心了,在例子的MainActivity上,有这么一段代码
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data);
if (mHelper == null) return;
// Pass on the activity result to the helper for handling
if (!mHelper.handleActivityResult(requestCode, resultCode, data)) {
// not handled, so handle it ourselves (here's where you'd
// perform any handling of activity results not related to in-app
// billing...
super.onActivityResult(requestCode, resultCode, data);
}
else {
Log.d(TAG, "onActivityResult handled by IABUtil.");
}
}
里面的注释写得很明白了,需要在onActivityResult调一下IabHelper的handleActivityResult,里面就有一个操作
// end of async purchase operation that started on launchPurchaseFlow
flagEndAsync();
================================
Unable to retrieve application xxxxxx from network
BasicNetwork.performRequest: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/me?language=zh_CN
There is no linked app associated with this client ID.
Application ID xxxxxxx is not associated with package xx.xx.xx. Check the application ID in your manifest.
这都是使用非测试人员登录googlePlay出现的报错,或者play services没有打开alpha/beta测试人员的开关,参照第2点加入测试人员即可
================================
Access Not Configured. Please use Google Developers Console to activate the API for your project.
去到
https://console.developers.google.com/project
点开“APIs & auth”->"Credentials"->点击项目名
在
Signing-certificate fingerprint
填入keystore的SHA1的值
5. 参考文档
G+登录
https://developers.google.com/identity/sign-in/android/
play game services
https://developers.google.com/games/services/android/quickstart
- 大小: 113.6 KB
- 大小: 27.8 KB
- 大小: 62.8 KB
分享到:
相关推荐
Google Play结算库V2.0.3版本 接入实例,主要实现了接入流程,及支付流程,及调用支付的封装
谷歌商店 接入应用内评价demo,找了一遍CSDN没找到自己实现了一个 博客文章链接:https://blog.csdn.net/t1446242775/article/details/109256073
项目接入前自己写的Demo,在手机上跑过没有问题,才接入到项目中, 各位可以放心使用。源码中没有包含说明文档,百度上面有很多博客文档查看。可以保证下载下来可直接打包运行。Unity版本:Unity2018.4.10 KeyStore...
GoogleAdmob接入封装,androidstudio中接入admob。
要想使用google play, google map等google应用,就必须安装Google Play Service,但Google Play Service有太多分支了,最近终于搞明白各个分支代表什么。 版本号最后三位(2104405-XYZ)分别表示Android版本,cpu的...
我不是兔子安卓实现,google play接入,排行榜接入,分享功能实现
google play services jar包
国内Google play game service排行榜的例子很少,所以我上传这个例子供Cocos2d-x、Android、Unity3D、Libgdx、Android Studio等开发者参考。 打开项目时,要先配置好Google play game service的框架。 总的来说...
Google Play服务用于更新Google应用和Google Play提供的其他应用。 此组件可提供多种核心功能,例如对您的Google服务进行身份验证、同步联系人信息、提供最新的用户隐私设置,以及低电耗的高品质位置信息服务。 此外...
Google Play
最近工作内容偏少,我就把最近公司游戏接入GoogleAdMob广告SDK的笔记整理了一下,做了个...已有50余款Googleplay上线游戏验证。本demo实现多个地方调用广告和集中处理不同回调方法,后续我还会更新更多的其他SDK资源。
Google Play GameService 官方demo typeNumber,BaseGameUtils
Google Play Services 软件,Google Play服务软件,Android 5.0+
软件名称:Google Play services 软件版本:v6.5.96官方全机型7版 软件语言:中文 软件大小:33.0M 软件包名:com.google.android.gms 支持系统:Android 2.2+ 【软件介绍】 7版详情:管他那么多,升了再说 10:...
Google Play services_v20.50.16 (080406-351607135).apk
google_play_services 最新
Google Play Store_v17.9.17-all [0] [PR] 284629082_apkpure.com.apk Google Play Store_v17.9.17-all [0] [PR] 284629082_apkpure.com.apk Google Play Store_v17.9.17-all [0] [PR] 284629082_apkpure.com.apk ...
Google Play 服务.apk
googleplay支付demo in-app-billing-v02 in-app-billing-v03