react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

Crash related to 'Support for pending purchases must be enabled'

Open kelcon opened this issue 7 years ago • 2 comments

Output:

08-23 00:43:47.227 13649 13707 D [Purchases] - DEBUG: Debug logging enabled.
08-23 00:43:47.227 13649 13707 D [Purchases] - DEBUG: SDK Version - 2.3.1
08-23 00:43:47.227 13649 13707 D [Purchases] - DEBUG: Initial App User ID - null
08-23 00:43:47.227 13649 13707 D [Purchases] - DEBUG: Generated New App User ID - 80e4ba36-0b6d-4930-a3dd-fbad94af8699
08-23 00:43:47.227 13649 13707 D [Purchases] - DEBUG: Identifying App User ID: 80e4ba36-0b6d-4930-a3dd-fbad94af8699
08-23 00:43:47.227 13649 13707 D [Purchases] - DEBUG: Listener set
08-23 00:43:47.227 13649 13649 D AndroidRuntime: Shutting down VM
08-23 00:43:47.227 13649 13649 E AndroidRuntime: FATAL EXCEPTION: main
08-23 00:43:47.227 13649 13649 E AndroidRuntime: Process: [..removed...], PID: 13649
08-23 00:43:47.227 13649 13649 E AndroidRuntime: java.lang.IllegalArgumentException: Support for pending purchases must be enabled. Enable this by calling 'enablePendingPurchases()' on BillingClientBuilder.
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at com.android.billingclient.api.BillingClient$Builder.build(BillingClient.java:309)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at com.revenuecat.purchases.BillingWrapper$ClientFactory.buildClient(BillingWrapper.kt:58)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at com.revenuecat.purchases.BillingWrapper$startConnection$1.run(BillingWrapper.kt:87)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:739)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:158)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7224)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
08-23 00:43:47.227 13649 13649 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
08-23 00:43:47.227   866  2623 W ActivityManager:   Force finishing activity pl.keler.pytania.ppla/.MainActivity
08-23 00:43:47.227 13649 13707 D [Purchases] - DEBUG: Sending latest purchaser info to listener

kelcon avatar Aug 22 '19 22:08 kelcon

Hi @kelcon! Are you using another in-app-purchases library that might be including the BillingClient 2.0?

vegaro avatar Aug 22 '19 22:08 vegaro

Hi @vegaro, you are right. I did not removed react-native-iap. Now it works correctly. Thank you.

On the next step I faced other issue - getProduct works correctly with 'android.test.purchased', although it returns null for active IAP subscription. I assume that is related to 'publication pending' status of the beta app.

kelcon avatar Aug 23 '19 07:08 kelcon