Question

Purchase Package : Parameter specified as non-null is null....

  • 26 December 2022
  • 1 reply
  • 199 views

Badge +1

When I run this command Purchases.purchasePackage(selected_package). I don't know where I am wrong.

 

My Function : 

const {purchaserInfo} = await Purchases.purchasePackage(selectedPackage);

 

 

Get this error from LogCat

12-26 11:46:43.991 25754 26222 E unknown:ReactNative: Exception in native call
12-26 11:46:43.991 25754 26222 E unknown:ReactNative: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter packageIdentifier
12-26 11:46:43.991 25754 26222 E unknown:ReactNative:   at com.revenuecat.purchases.hybridcommon.CommonKt.purchasePackage(Unknown Source:2)
12-26 11:46:43.991 25754 26222 E unknown:ReactNative:   at com.revenuecat.purchases.react.RNPurchasesModule.purchasePackage(RNPurchasesModule.java:148)

 

 


1 reply

Userlevel 3
Badge +8

Hi Yusuf,

 

Can you send the full debug logs? 

 

You can enable debug logs by following this guide. After they're enabled you'll see logs like this in the console:

[Purchases] - DEBUG: No cached entitlements, fetching
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200
[Purchases] - DEBUG: Purchaser info updated, sending to delegate

Please ensure the debug logs include the entire app life-cycle, including the messages printed during initialization of the SDK. The more information you include here, the better we'll be able to help.

Reply