I am trying to integrate Revenue cat in my React native android project but cannot get rid of this error
>TypeError: Cannot read property 'setupPurchases' of null]
please provide me steps to solve this error as i have gone through all the above steps read articles watched videos implemented example and in every thing this error is common please help on this @React native team , @ Revenue cat community
ERROR IN REVENUE CAT SDK SETUP in APP.JS
This post has been closed for comments
![Well Said! Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/493788ac-9f11-4bd0-894f-17bad247511c_thumb.png)
From couple of weeks i am struggling to solve this error with no luck followed all the steps from documentation , to youtube tutorial but nothing is working kindly help to resolve this error
Hi
import { Platform } from 'react-native';
//...
export default class App extends React.Component {
componentDidMount() {
Purchases.setLogLevel(Purchases.LOG_LEVEL.DEBUG);
if (Platform.OS === 'ios') {
await Purchases.configure({ apiKey: <public_apple_api_key> });
} else if (Platform.OS === 'android') {
await Purchases.configure({ apiKey: <public_google_api_key> });
// OR: if building for Amazon, be sure to follow the installation instructions then:
await Purchases.configure({ apiKey: <public_amazon_api_key>, useAmazon: true });
}
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.