Is it possible to debug locally Google Play's in-app billing in Android Studio?

后端 未结 5 925
悲&欢浪女
悲&欢浪女 2020-12-02 15:33

I am getting this error testing in-app subscription products locally.

authentication is required. you need to sign in to your google account

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 16:37

    I assume, that when you initialize the 'billing helper', you provide it with a Base64 public key from the developer console. That key corresponds to your release certificate.

    The message you get suggests, that you are probably trying to run your app in debug mode. That means, that your app is signed using the debug certificate (a default one). If I am right, that explains, why you are not being authenticated.

    Unfortunately, the only way to test the in-app billing, is within an app signed using the release certificate, on a device logged in to an account, that is defined as 'Gmail accounts with testing access' and your app has to be published to Google Play (alpha/beta/production).

提交回复
热议问题