我已在我的应用程序中实施了In app purchase。我已经按照给定网址的所有步骤进行操作。
http://developer.android.com/google/play/billing/billing_integrate.html
当我运行我的代码时,我在mServiceConn中得到了空指针异常。我有debuge代码,发现永远不会调用onServiceConnected(),所以不建立serviceconnection。
任何人都可以帮我吗?
答案 0 :(得分:0)
在尝试找到合适解决方案的几个小时内,同样的问题让我意外地解决了这个问题。在此之后我成功完成了测试购买:
设置GoogleApiClient - https://developer.android.com/google/auth/api-client.html。 我使用此客户端设置从Google Plus服务获取Google帐户ID:
mGoogleApiClient = new GoogleApiClient.Builder(mContext)
.addApi(Plus.API)
.addScope(Plus.SCOPE_PLUS_PROFILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
手动安装并重新安装后 Google Plus服务 - https://play.google.com/store/apps/details?id=com.google.android.gms
重新发布apk in beta chanel
最后通过 Google+社区