Я скоро сойду с ума по этому поводу, но здесь все сказано: -)
Я хочу использовать RevenueCat/react-native-purchases
в своем проекте, но как только я импортирую
import Purchases from 'react-native-purchases';
Я получаю сообщение "Нативный модуль не может быть нулевым"
У меня есть тестовое репо с голым проектом , где я не могу заставить его работать либо
Вы можете увидеть в репозитории package.json и Podfile - я использую пряжу, чтобы собрать все вместе.
Я добавил libRNPurchases.a
в свой проект в Xcode иЯ повторял эти инструкции так много раз: - $
Для краткой справки вот мой файл package.json
{
"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
}
PodFile:
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
Я использую React-Native "0.59.10" из-за expo - поэтому он все еще использует старый формат файла pod.
Есть идеи, что мне нужно сделать?