I am going to lose my mind over this soon, but here it goes :-)
I am wanting to use RevenueCat/react-native-purchases
in my project, but as soon as I import
import Purchases from 'react-native-purchases';
I get the message "Native module cannot be null"
I have a test repo with a bare project where I can't get it to work either
You can see in the repo the package.json and the Podfile - I am using yarn to put it all together.
I have added libRNPurchases.a
to my project in Xcode and I have redone these instructions so many times :-$
For a quick reference here is my package.json file
{
"scripts": {
"postinstall": "jetify",
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "0.59.10",
"react-native-gesture-handler": "~1.3.0",
"react-native-purchases": "^2.4.1",
"react-native-reanimated": "~1.2.0",
"react-native-screens": "1.0.0-alpha.23",
"react-native-unimodules": "~0.5.4",
"react-native-web": "^0.11.7"
},
"devDependencies": {
"@babel/core": "^7.6.0",
"babel-jest": "24.9.0",
"jest": "24.9.0",
"jetifier": "^1.6.4",
"metro-react-native-babel-preset": "0.56.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
},
"private": true
}
The PodFile is:
platform :ios, '11.0'
require_relative '../node_modules/react-native-unimodules/cocoapods'
target 'IAPTEST2' do
# Pods for IAPTEST
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
'RCTActionSheet',
'RCTAnimation',
'RCTBlob',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
]
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'
pod 'RNReanimated', :podspec => '../node_modules/react-native-reanimated/RNReanimated.podspec'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
use_unimodules!
pod 'RNPurchases', :path => '../node_modules/react-native-purchases'
pod 'Purchases', '~> 2.6'
end
I am using React-Native "0.59.10" because of expo - so it is still using the old pod file format.
Any ideas what I need to do?