"Native module cannot be null" thrown when importing Purchases in javascript
I have followed the installation instructions and got the project to build successfully. Now, when I import Purchases in my javascript code I get the exception "Native module cannot be null".

Where revenueCatService.js:2 is where I have imported Purchases.
Clicking on <unknown> index.js:5:21 takes me to index.js in react-native-purchases:

System Xcode 10 MacOS Mojave React native 0.50.4
I was able to solve the issue by adding libRNPurchases.a in the Linked Frameworks and Libraries.
@vegaro This is a critical step that is missing from the README. I was getting the same error until I did the step above of adding libRNPurchases.a to Link Binary with Libraries. You might want to add this as one of the gifs.
Hey @systemride,
Did you run react-native link react-native-purchases?
That should make sure the RNPurchases lib file is integrated.
When I run react-native link react-native-purchases all that does is add a line to my Podfile. I am unable to use cocoapods for this so I add it in manually.
Got it. Thanks.
We'll run through the integration again cold and make sure we get the missing step added. ᐧ
On Thu, Feb 28, 2019 at 9:04 AM Nick Redmond [email protected] wrote:
When I run react-native link react-native-purchases all that does is add a line to my Podfile. I am unable to use cocoapods for this so I add it in manually.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/RevenueCat/react-native-purchases/issues/23#issuecomment-468353296, or mute the thread https://github.com/notifications/unsubscribe-auth/AAId9iVXuSjKzUQSv1_Gdf41Iesf0FXcks5vSAwygaJpZM4XIEUE .
I added the step to the README. I was able to reproduce this by running react-native link in a project that contains a Podfile. It looks like react-native link behaves in a different way if it detects the project uses Cocoapods. If the project doesn't use Cocoapods (there is no Podfile) the link to the static library is properly added.