本文介绍了是否可以在Android Studio中本地调试Google Play的应用内结算?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地获取了应用内订阅产品的错误测试。

我能够检查产品的库存,但不应该也是能够购买它?



有很多关于为什么可能会发生这种错误的帖子,我认为这是可以解决的:


  • 该产品在测试版频道中发布且启用了应用内结算功能
  • 我通过设备上的测试用户许可帐户登录到Play商店。


    是通过beta / alpha通道测试实际购买量的唯一方法 - 不是从android studio直接购买。这篇文章表明它可能(见屏幕截图)




  • b
    $ b

    以下是使用 Android Studio 签署的apk附加步骤:



    我在Windows上。它有助于在PATH中拥有 adb.exe ,对我来说就是:




    1. 在Google Play控制台中,确保该应用在Alpha或Beta频道中已发布(初始处理后是<是一次性手动步骤),并且您拥有经过授权的测试gmail帐户(来自帐户设置部分)也位于Alpha / Beta测试人员列表中,并且不是应用帐户的所有者。此帐户是设备上唯一的帐户。
    2. 具有以下设置:
      AndroidManifest.xml $ 应用程序节点






    1. 从Android Studio生成已签名的APK


    2. 连接设备以进行USB调试。删除当前安装:





      1. 安装发布路径)






      1. 打开设备上的应用程序。从Android Studio的运行菜单中,最后一个选项是将调试器附加到Android Process - 选择您的设备。您正在调试。

      NB 对于应用内结算,版本号需要与当前版本号匹配发布在Play商店


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

      I was able to check the the inventory for the product but shouldn't I also be able to purchase it?

      There are a number of posts about why this error might occur which I thought were addressed:

      • the product is released in the beta channel with in-app billing enabled
      • i am logged into Play Store with a test user licensed account on the device.

      Is the only way to test actual purchases via the beta/alpha channels - not straight from android studio. This post suggests it possible (see screen shot)

      http://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test

      解决方案

      In essence, in-app billing payments can only be tested with a release-signed apk (the one we upload to Google Play Console).

      Here are some steps that got me attached to a signed apk with Android Studio:

      I'm on Windows. It helps having adb.exe in the PATH, for me that's:

      1. In Google Play Console, ensure the app is published (< is a one-time manual step after its initially processed) in alpha or beta channel and you have a licensed test gmail account (from the Account Settings section) that is also in the list of alpha/beta testers and is not the owner of the app account. This account is the only account on the device. Release the apk and ensure it all works from an installed version from the Play Store.
      2. Have these settings:In AndroidManifest.xml under application node

      And in your build.gradle file under android > buildTypes > release, add:

      1. Generate a signed APK from Android Studio

      2. Attach your device for USB debugging. Remove current install:

      1. Install it (from the release path)
      1. Open the app on the device. From Android Studio's Run menu, last option is "Attach debugger to Android Process" - select your device. You are now debugging.

      NB for in-app billing the build number needs to match the one currently published on Play Store

      这篇关于是否可以在Android Studio中本地调试Google Play的应用内结算?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    10-19 18:35