title: Testing google subscription in android app not working
body: <p><a href="https://i.stack.imgur.com/c30X0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c30X0.png" alt="enter image description here" /></a></p>
  <p>That is the error I am getting in log. I don't know what it means I have everytihng up to date. I am using Redmi Note 8 as testing device.</p>
  <p>I have permission in manifest set as &quot;<strong></strong>&quot;</p>
  <p>I was following entire guide on their page how to set up app subscription and how to test it. Whole code is copied. On my brothers phone which is S10 Galaxy it just shows small dialog window but it does not show the item which he can purchase.</p>
  <p>This is the class which I have created:</p>
  <pre><code>public class SubscriptionInitializer {
  private BillingClient mBillingClient;
  private PurchasesUpdatedListener mPurchasesUpdatedListener;
  
  
  
  public SubscriptionInitializer(Context context){
      initPurchasesListener();
      buildBillingClient(context);
  }
  
  
  public void startBillingConnection(Context context){
      
      mBillingClient.startConnection(new BillingClientStateListener() {
          @Override
          public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
  
              if (billingResult.getResponseCode() ==  BillingClient.BillingResponseCode.OK) {
                  // The BillingClient is ready. You can query purchases here.
  
                  Log.d(&quot;ARRAY&quot;, &quot;Billing setupFinished&quot;);
  
                  List&lt;String&gt; skuList = new ArrayList&lt;&gt;();
                  skuList.add(&quot;inner_monthly_sub&quot;);
                  SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
                  params.setSkusList(skuList).setType(BillingClient.SkuType.SUBS);
                  mBillingClient.querySkuDetailsAsync(params.build(),
                          (billingResult1, skuDetailsList) -&gt; {
                              // Retrieve a value for &quot;skuDetails&quot; by calling querySkuDetailsAsync().
                              BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
                                      .setSkuDetails(skuDetailsList.get(0))
                                      .build();
  
                              int responseCode = mBillingClient.launchBillingFlow((Activity)context, billingFlowParams).getResponseCode();
                          });
  
              }
              else {
                  Log.d(&quot;ARRAY&quot;, billingResult.getDebugMessage());
              }
          }
          @Override
          public void onBillingServiceDisconnected() {
              // Try to restart the connection on the next request to
              // Google Play by calling the startConnection() method.
              Log.d(&quot;ARRAY&quot;, &quot;Billing disconnected&quot;);
              mBillingClient.startConnection(this);
          }
      });
  
  }
  
  
  private void initPurchasesListener(){
  
      mPurchasesUpdatedListener = (billingResult, purchases) -&gt; {
          Log.d(&quot;ARRAY&quot;, &quot;Purchase Listener initialization&quot;);
      };
  }
  
  private void buildBillingClient(Context context){
      mBillingClient = BillingClient.newBuilder(context)
              .setListener(mPurchasesUpdatedListener)
              .enablePendingPurchases()
              .build();
  }
  </code></pre>
  <p>}</p>
  <p><strong>startBillingConnection</strong> method I call in MainActivity just after <strong>setContentView</strong> .</p>
  <p>I have the app uploaded in Internal Testing in google play console and it is published there and I have set every email that I have as licensed emails.</p>
  <p>Please help as google developer pages are unhelpful since every mail I've sent them they never responded and guides are outdated.</p>