Open mihailapuste opened 2 months ago
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Can you please share some logs from the LogCat so we can see what's going on?
Thank you!
Can you please share some logs from the LogCat so we can see what's going on?
Thank you!
@vegaro
Hi there So here are the relevant logcat logs. Since the app hangs, there were no logs past these that were relevant as far as I could tell.
2024-09-17 18:03:52.203 28868-29015 elabs.app.de com.group.app.dev E Invalid ID 0x00000223.
2024-09-17 18:03:52.207 28868-29102 ReactNativeJS com.group.app.dev I 'begin_checkout', { product_id: 'com.group.app.dev.premium.subscription.annually.promo2:p1y',
has_promo: false,
promo_code: null,
intro_screen_type: 'default',
purchase_state: 'INTRO',
hard_paywall_enabled: false,
trial_period: null,
duration: 'ANNUAL',
offering: 'promo2',
has_referral_user: false,
ios_promotional_offer_product: null,
available_discounts: undefined,
selected_discount: undefined,
has_completed_onboarding: false,
subscription_screen_placement: 'ONBOARDING_GET_STARTED',
source: 'GetStartedScreen' }
2024-09-17 18:03:52.247 28868-29104 unknown:ReactNative com.group.app.dev E Caught NullPointerException when dispatching message in MessageQueueThreadHandler. This is likely caused by runnable(msg.callback) being nulled in Android Handler after dispatching and before handling (see T170239922 for more details).Currently we observe that it only happen once which is during initialisation. Due to fixing probably involve Android System code, we decide to ignore here for now and print an error message for debugging purpose in case this cause more serious issues in future.
2024-09-17 18:03:54.156 28868-29443 BufferPoolAccessor2.0 com.group.app.dev D bufferpool2 0x6e587b1a98 : 5(8417280 size) total buffers - 5(8417280 size) used buffers - 642/648 (recycle/alloc) - 6/649 (fetch/transfer)
2024-09-17 18:03:54.535 28868-29440 CCodecBufferChannel com.group.app.dev D [c2.android.aac.decoder#901] DEBUG: elapsed: n=6 [in=0 pipeline=0 out=2]
2024-09-17 18:03:54.535 28868-29440 CCodecBufferChannel com.group.app.dev D [c2.qti.avc.decoder#511] DEBUG: elapsed: n=28 [in=0 pipeline=0 out=24]
2024-09-17 18:03:54.918 28868-29452 BufferPoolAccessor2.0 com.group.app.dev D bufferpool2 0x6e587de528 : 5(40960 size) total buffers - 1(8192 size) used buffers - 1284/1289 (recycle/alloc) - 6/1280 (fetch/transfer)
2024-09-17 18:03:57.844 28868-29440 CCodecBufferChannel com.group.app.dev D [c2.qti.avc.decoder#511] DEBUG: elapsed: n=28 [in=0 pipeline=0 out=24]
2024-09-17 18:03:57.939 28868-29452 CCodec com.group.app.dev I state->set(FLUSHING)
2024-09-17 18:03:57.940 28868-29452 CCodec com.group.app.dev I state->set(FLUSHED)
2024-09-17 18:03:57.941 28868-29420 MediaCodec com.group.app.dev D keep callback message for reclaim
2024-09-17 18:03:57.941 28868-29452 CCodec com.group.app.dev I state->set(RESUMING)
2024-09-17 18:03:57.942 28868-29452 CCodecConfig com.group.app.dev I query failed after returning 19 values (BAD_INDEX)
2024-09-17 18:03:57.942 28868-29452 Codec2Client com.group.app.dev W query -- param skipped: index = 1342179345.
2024-09-17 18:03:57.942 28868-29452 Codec2Client com.group.app.dev W query -- param skipped: index = 2415921170.
2024-09-17 18:03:57.942 28868-29452 Codec2Client com.group.app.dev W query -- param skipped: index = 1610614798.
2024-09-17 18:03:57.943 28868-29452 CCodec com.group.app.dev I state->set(RUNNING)
attempt 2 with different product
2024-09-17 18:06:42.707 30171-30352 ReactNativeJS com.group.app.dev I 'begin_checkout', { product_id: 'com.group.app.dev.premium.subscription.quarterly.promo1b:p3m',
has_promo: true,
promo_code: 'promo1',
intro_screen_type: 'default',
purchase_state: 'ALL_PLANS',
hard_paywall_enabled: false,
trial_period: null,
duration: 'THREE_MONTH',
offering: 'promo1',
has_referral_user: false,
ios_promotional_offer_product: null,
available_discounts: undefined,
selected_discount: undefined,
has_completed_onboarding: true,
subscription_screen_placement: 'ONBOARDING_GET_STARTED',
source: 'SubscriptionBottomBar' }
2024-09-17 18:06:42.739 30171-30353 unknown:ReactNative com.group.app.dev E Caught NullPointerException when dispatching message in MessageQueueThreadHandler. This is likely caused by runnable(msg.callback) being nulled in Android Handler after dispatching and before handling (see T170239922 for more details).Currently we observe that it only happen once which is during initialisation. Due to fixing probably involve Android System code, we decide to ignore here for now and print an error message for debugging purpose in case this cause more serious issues in future.
2024-09-17 18:06:44.932 30171-30492 BufferPoolAccessor2.0 com.group.app.dev D bufferpool2 0x6e587b8998 : 5(8417280 size) total buffers - 5(8417280 size) used buffers - 878/884 (recycle/alloc) - 6/885 (fetch/transfer)
code
export async function makePurchase(
offering: IOfferModel,
): Promise<MakePurchaseStatusTypes> {
try {
const { product } = offering;
const purchaseMade = await Purchases.purchaseStoreProduct(
product
);
@vegaro
Hello! Just wondering if there is any update on this issue, I've updated to 8.2.3 and the issue seems to persist. Please let me know if there is any other information I can provide to help assist in resolving this matter.
Thank you so much!
Sorry I dropped the ball here. I'll look into this today
ok, so I looked into it and I am honestly very confused:
purchaseProduct
and purchaseStoreProduct
both call the same internal function, purchaseStoreProduct
literally extracts the identifier in the exact same way as you do: public static async purchaseProduct(
productIdentifier: string,
upgradeInfo?: UpgradeInfo | null,
type: PURCHASE_TYPE = PURCHASE_TYPE.SUBS
): Promise<MakePurchaseResult> {
await Purchases.throwIfNotConfigured();
return RNPurchases.purchaseProduct(
productIdentifier,
upgradeInfo,
type,
null,
null,
null
).catch((error: PurchasesError) => {
error.userCancelled =
error.code === PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
throw error;
});
public static async purchaseStoreProduct(
product: PurchasesStoreProduct,
googleProductChangeInfo?: GoogleProductChangeInfo | null,
googleIsPersonalizedPrice?: boolean | null
): Promise<MakePurchaseResult> {
await Purchases.throwIfNotConfigured();
return RNPurchases.purchaseProduct(
product.identifier,
googleProductChangeInfo,
product.productCategory,
null,
googleIsPersonalizedPrice == null
? null
: { isPersonalizedPrice: googleIsPersonalizedPrice },
product.presentedOfferingContext
).catch((error: PurchasesError) => {
error.userCancelled =
error.code === PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
throw error;
});
}
I don't see the Caught NullPointerException when dispatching message
in my logs, I wonder if it has something to do with this... do you see that log when using the working purchaseProduct
?
Do you mind enabling RevenueCat debug logs? You can enable those using Purchases.setLogLevel(Purchases.LOG_LEVEL.DEBUG);
. Maybe we get to see more related logs that way
Thank you and sorry again I took so long to answer
@vegaro
iOS
Caught NullPointerException when dispatching message
is visible only when using the purchaseStoreProduct
so it likely is an error related to that (see logs below)I've enabled the debug logs and captured the relevant logs from a successful attempt using the deprecated fn, and non-successful attempt using the non-deprecated fn.
🟢 Successful attempt using deprecated FN purchaseProduct(product.identifier)
2024-10-16 15:08:48.456 4587-5213 CCodecBufferChannel com.group.company.dev I [c2.android.aac.decoder#881] 4 initial input buffers available
2024-10-16 15:08:48.831 4587-4587 ViewRootIm...nActivity] com.group.company.dev I ViewPostIme pointer 0
2024-10-16 15:08:48.956 4587-4587 ViewRootIm...nActivity] com.group.company.dev I ViewPostIme pointer 1
2024-10-16 15:08:48.960 4587-4780 efoo.company.de com.group.company.dev E Invalid ID 0x00000223.
2024-10-16 15:08:48.979 4587-5159 ReactNativeJS com.group.company.dev I 'begin_checkout', { product_id: 'com.group.company.dev.premium.subscription.annually.promo2:p1y',
has_promo: false,
promo_code: null,
intro_screen_type: 'default',
purchase_state: 'INTRO',
hard_paywall_enabled: false,
trial_period: null,
duration: 'ANNUAL',
offering: 'promo2',
has_referral_user: false,
ios_promotional_offer_product: null,
available_discounts: undefined,
selected_discount: undefined,
has_completed_onboarding: false,
subscription_screen_placement: 'ONBOARDING_GET_STARTED',
source: 'GetStartedScreen' }
2024-10-16 15:08:49.022 4587-5205 MediaCodec com.group.company.dev W mapFormat: no mediaType information
2024-10-16 15:08:49.056 4587-5160 [Purchases] - DEBUG com.group.company.dev D ℹ️ Requesting products from the store with identifiers: com.group.company.dev.premium.subscription.annually.promo2
2024-10-16 15:08:49.103 4587-5231 [Purchases] - DEBUG com.group.company.dev D ℹ️ Products request finished for com.group.company.dev.premium.subscription.annually.promo2
2024-10-16 15:08:49.104 4587-5231 [Purchases] - DEBUG com.group.company.dev D 💰 Retrieved productDetailsList: ProductDetails{jsonString='{"productId":"com.group.company.dev.premium.subscription.annually.promo2","type":"subs","title":"company Premium Annual Subscription Promo 2 (company-dev)","name":"company Premium Annual Subscription Promo 2","description":"company Premium Annual Subscription Promo 2","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp","subscriptionOfferDetails":[{"offerIdToken":"AarRn8qofubjqxMMAVw\/2snsHTnhhdniE9ufy8DxYP66pPEY\/vypRHq36\/+2MRG\/g586Ek8Ndg==","basePlanId":"p1y","pricingPhases":[{"priceAmountMicros":68990000,"priceCurrencyCode":"CAD","formattedPrice":"$68.99","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"com.group.company.dev.premium.subscription.annually.promo2","type":"subs","title":"company Premium Annual Subscription Promo 2 (company-dev)","name":"company Premium Annual Subscription Promo 2","description":"company Premium Annual Subscription Promo 2","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp","subscriptionOfferDetails":[{"offerIdToken":"AarRn8qofubjqxMMAVw\/2snsHTnhhdniE9ufy8DxYP66pPEY\/vypRHq36\/+2MRG\/g586Ek8Ndg==","basePlanId":"p1y","pricingPhases":[{"priceAmountMicros":68990000,"priceCurrencyCode":"CAD","formattedPrice":"$68.99","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}, productId='com.group.company.dev.premium.subscription.annually.promo2', productType='subs', title='company Premium Annual Subscription Promo 2 (company-dev)', productDetailsToken='AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@92834f5]}
2024-10-16 15:08:49.104 4587-5231 [Purchases] - DEBUG com.group.company.dev D 💰 com.group.company.dev.premium.subscription.annually.promo2 - ProductDetails{jsonString='{"productId":"com.group.company.dev.premium.subscription.annually.promo2","type":"subs","title":"company Premium Annual Subscription Promo 2 (company-dev)","name":"company Premium Annual Subscription Promo 2","description":"company Premium Annual Subscription Promo 2","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp","subscriptionOfferDetails":[{"offerIdToken":"AarRn8qofubjqxMMAVw\/2snsHTnhhdniE9ufy8DxYP66pPEY\/vypRHq36\/+2MRG\/g586Ek8Ndg==","basePlanId":"p1y","pricingPhases":[{"priceAmountMicros":68990000,"priceCurrencyCode":"CAD","formattedPrice":"$68.99","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"com.group.company.dev.premium.subscription.annually.promo2","type":"subs","title":"company Premium Annual Subscription Promo 2 (company-dev)","name":"company Premium Annual Subscription Promo 2","description":"company Premium Annual Subscription Promo 2","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp","subscriptionOfferDetails":[{"offerIdToken":"AarRn8qofubjqxMMAVw\/2snsHTnhhdniE9ufy8DxYP66pPEY\/vypRHq36\/+2MRG\/g586Ek8Ndg==","basePlanId":"p1y","pricingPhases":[{"priceAmountMicros":68990000,"priceCurrencyCode":"CAD","formattedPrice":"$68.99","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}, productId='com.group.company.dev.premium.subscription.annually.promo2', productType='subs', title='company Premium Annual Subscription Promo 2 (company-dev)', productDetailsToken='AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@92834f5]}
2024-10-16 15:08:49.106 4587-4587 [Purchases] - DEBUG com.group.company.dev D 💰 Purchase started - product: Subscription(productId=com.group.company.dev.premium.subscription.annually.promo2, optionId=p1y, productDetails=ProductDetails{jsonString='{"productId":"com.group.company.dev.premium.subscription.annually.promo2","type":"subs","title":"company Premium Annual Subscription Promo 2 (company-dev)","name":"company Premium Annual Subscription Promo 2","description":"company Premium Annual Subscription Promo 2","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp","subscriptionOfferDetails":[{"offerIdToken":"AarRn8qofubjqxMMAVw\/2snsHTnhhdniE9ufy8DxYP66pPEY\/vypRHq36\/+2MRG\/g586Ek8Ndg==","basePlanId":"p1y","pricingPhases":[{"priceAmountMicros":68990000,"priceCurrencyCode":"CAD","formattedPrice":"$68.99","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"com.group.company.dev.premium.subscription.annually.promo2","type":"subs","title":"company Premium Annual Subscription Promo 2 (company-dev)","name":"company Premium Annual Subscription Promo 2","description":"company Premium Annual Subscription Promo 2","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp","subscriptionOfferDetails":[{"offerIdToken":"AarRn8qofubjqxMMAVw\/2snsHTnhhdniE9ufy8DxYP66pPEY\/vypRHq36\/+2MRG\/g586Ek8Ndg==","basePlanId":"p1y","pricingPhases":[{"priceAmountMicros":68990000,"priceCurrencyCode":"CAD","formattedPrice":"$68.99","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}, productId='com.group.company.dev.premium.subscription.annually.promo2', productType='subs', title='company Premium Annual Subscription Promo 2 (company-dev)', productDetailsToken='AEuhp4J6vrQh3Od3QPymXyCK9IwhQsuRz-VW1vVMnGPXz9D_sQRkc1812171Yypr0mnp', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@92834f5]}, token=AarRn8qofubjqxMMAVw/2snsHTnhhdniE9ufy8DxYP66pPEY/vypRHq36/+2MRG/g586Ek8Ndg==) null
2024-10-16 15:08:49.106 4587-4587 [Purchases] - DEBUG com.group.company.dev D 💰 Purchasing product: com.group.company.dev.premium.subscription.annually.promo2
2024-10-16 15:08:49.126 4587-4587 SensorManager com.group.company.dev D unregisterListener
2024-10-16 15:08:49.153 4587-4587 DecorView com.group.company.dev I [INFO] isPopOver=false, config=true
2024-10-16 15:08:49.153 4587-4587 DecorView com.group.company.dev I updateCaptionType >> DecorView@936768c[], isFloating=false, isApplication=true, hasWindowControllerCallback=true, hasWindowDecorCaption=false
2024-10-16 15:08:49.153 4587-4587 DecorView com.group.company.dev D setCaptionType = 0, this = DecorView@9
🔴 Unsuccessful attempt using purchaseStoreProduct(product)
2024-10-16 15:11:52.733 5800-5911 efoo.company.de com.group.company.dev E Invalid ID 0x00000223.
2024-10-16 15:11:52.748 5800-5996 ReactNativeJS com.group.company.dev I 'begin_checkout', { product_id: 'com.group.company.dev.premium.subscription.annually.promo2:p1y',
has_promo: false,
promo_code: null,
intro_screen_type: 'default',
purchase_state: 'INTRO',
hard_paywall_enabled: false,
trial_period: null,
duration: 'ANNUAL',
offering: 'promo2',
has_referral_user: false,
ios_promotional_offer_product: null,
available_discounts: undefined,
selected_discount: undefined,
has_completed_onboarding: false,
subscription_screen_placement: 'ONBOARDING_GET_STARTED',
source: 'GetStartedScreen' }
2024-10-16 15:11:52.810 5800-5997 unknown:ReactNative com.group.company.dev E Caught NullPointerException when dispatching message in MessageQueueThreadHandler. This is likely caused by runnable(msg.callback) being nulled in Android Handler after dispatching and before handling (see T170239922 for more details).Currently we observe that it only happen once which is during initialisation. Due to fixing probably involve Android System code, we decide to ignore here for now and print an error message for debugging purpose in case this cause more serious issues in future.
2024-10-16 15:11:54.402 5800-6181 CCodec com.group.company.dev I state->set(FLUSHING)
2024-10-16 15:11:54.403 5800-6181 CCodec com.group.company.dev I state->set(FLUSHED)
2024-10-16 15:11:54.403 5800-6143 MediaCodec com.group.company.dev D keep callback message for reclaim
Thank you for all your help and please let me know if there is anything else I can provide you with. Thanks!
Hi
@vegaro Just following up and wondering if there are any updates. Thanks
@mihailapuste I took a look last week again and was unable to shed any more light on this issue.
I'll check again this week. One thing I will test is using your same React Native version, just in case it's that.
Did you try with your other device and also saw it happening? Apart from the s21 and p30
Are the devices that can reproduce it using the same OS version?
Do you think you can provide a minimal reproducible example code? I wonder if you can reproduce because your app has some different setup than our tester app. I'm also wondering if some dependency might be interfering, which I've seen before.
If you can share your package.json maybe I can try copying it to a new project and see if that reproduces the issue
Gave another try using a barebones RN 0.73.8 without luck...
I have pushed a branch with extra logging that might help us debug this better:
"react-native-purchases": "RevenueCat/react-native-purchases#extra-logs-purchase-product"
If you could install that branch and send the logs for both purchaseProduct
and purchaseStoreProduct
I would appreciate it. It would help me identify where the issue lives.
I've also pushed a extremely simple app https://github.com/RevenueCat/react-native-purchases/tree/extra-logs-purchase-product/MyNewApp to that branch as well, that just configures the SDK and calls both functions, and it just doesn't hang. If you can give that a try in your device I would appreciate it. You would need to update the API key in App.tsx and the applicationId
in app/build.gradle
. That way we can see if it's device related.
@mihailapuste I was just thinking about this again...
export async function makePurchase(
offering: IOfferModel,
): Promise<MakePurchaseStatusTypes> {
try {
const { product } = offering;
const purchaseMade = await Purchases.purchaseStoreProduct(
product
);
What's const { product } = offering;
? Are you positive product
is a StoreProduct
? How are you getting that StoreProduct
, are you getting it directly from the package
inside the offerings
object?
I was looking at this other issue https://github.com/RevenueCat/react-native-purchases/issues/989#issuecomment-2282192187 and they are seeing a similar behaviour when passing the wrong product id so I am wondering if something like that is happening here
Describe the bug
Upgrading to the latest
react-native-purchases
from7.2.1
to8.2.0
, I noticed that we were previously using the now deprecatedpurchaseProduct()
function to make purchases.This was, and still does work perfectly fine on iOS and android. But to comply with the latest docs, I replaced this function with
purchaseStoreProduct
and passed the correct parameters.When testing on
iOS
there was no issue, and I could make the purchase as before, however onandroid
this new function causes the purchase to simply hang. No errors returned, it just seems to hang for an indefinite period. When reverting back topurchaseProduct
, it works again.Wondering if anyone else has experienced this issue, as I could not find any related issues in the comunity threads or gh tickets.
Thanks in advance!
android
8.2.0
0.73.8
Additional context Add any other context about the problem here.