Skip to main content
Question

Android com.revenuecat.purchases.hybridcommon.CommonKt.purchasePackage java.lang.NullPointerException

  • 21 June 2023
  • 1 reply
  • 74 views

Forum|alt.badge.img+4

Hello i got a error about com.revenuecat.purchases.hybridcommon.CommonKt.purchasePackage java.lang.NullPointerException. Its working for me but when i check the Play Store Crashlytics i saw the this error. I tried the update version revenuecat 6 but i got still this error. How can i fix that. Can u help me please ? 

My code is 

 

const initPurchase = async () => {

try {

let deviceId = await global.deviceID;

Purchases.configure({

apiKey:

Platform.OS === 'ios' ? RevenueCat_API_KEY : RevenueCat_API_Google,

appUserID: deviceId,

});

} catch (e) {

console.log(e);

}

}


 

export const purchase = async product => {

 

try {

const { customerInfo } = await Purchases.purchasePackage(product);

const { entitlements } = customerInfo;

 

if (typeof entitlements.active[ENTITLEMENT_ID] !== 'undefined') {

OneSignal.sendTag('premium', 'true');

AsyncStorage.setItem('premium', 'true');

store.isPremiumUpdate(true);

return customerInfo;

} else {

return false;

}

} catch (e) {

Alert.alert(global.appName, e.message);

return false;

}

};

 

1 reply

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • June 22, 2023

Hi,

Are you able to get the whole stacktrace of this error from Crashlytics? That would really help us investigate.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings