Skip to content

Bug: Android QueryProduct fails with OpenIapError$QueryProduct #137

@quangtuan28200

Description

@quangtuan28200

Description

On Android, querying products sometimes fails with OpenIapError$QueryProduct: Failed to query product.

The error appears from ProductManager$getOrQuery$3$1.onProductDetailsResponse, but the stack trace does not expose the original Google Billing response code/message, so it is difficult to debug whether this is caused by product configuration, Play Store state, billing availability, or library behavior.

Stack traces

dev.hyo.openiap.OpenIapError$QueryProduct: Failed to query product
at dev.hyo.openiap.helpers.ProductManager$getOrQuery$3$1.onProductDetailsResponse(ProductManager.kt:103)
at com.android.billingclient.api.BillingClientImpl.zzt(com.android.billingclient:billing@@8.3.0:13)
at com.android.billingclient.api.zzbf.call(Unknown Source:6)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)

dev.hyo.openiap.OpenIapError$QueryProduct: Failed to query product
at dev.hyo.openiap.helpers.ProductManager$getOrQuery$3$1.onProductDetailsResponse(ProductManager.kt:95)
at com.android.billingclient.api.BillingClientImpl.zzt(com.android.billingclient:billing@@8.3.0:13)
at com.android.billingclient.api.zzbf.call(Unknown Source:6)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)

Expected behavior

queryProduct / getProducts should either:

  1. Return the available products/subscriptions successfully, or
  2. Return a more detailed error including:
    • Billing response code
    • Billing debug message
    • Product IDs being queried
    • Product type: inapp or subs
    • Whether Google Billing returned an empty product list

Actual behavior

The app only receives:

OpenIapError$QueryProduct: Failed to query product

without enough details to identify the root cause.

Environment

  • Platform: Android
  • Library: openiap / react-native-iap
  • Google Billing Client: billing@@8.3.0
  • Product types used:
    • Subscriptions
    • Non-consumable lifetime product

Questions

  1. Is this error usually caused by Google Play product configuration, or can it also happen due to Billing Client response handling?
  2. Can the library expose the original BillingResult.responseCode and BillingResult.debugMessage in this error?
  3. Is there any known issue around ProductManager.kt line 95 / 103 when Google Billing returns an empty product list?
  4. What is the recommended way to debug which specific SKU/product ID failed?

Additional context

This issue happens while querying products before purchase. It may affect users who cannot see subscription or lifetime product details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions