试图运行一个世博反应本地项目w/收益猫集成。但是,每当我下载了react-native-pruchases库时,我就会继续得到这个错误。
Invariant Violation: Native module cannot be null
我通过运行npm install react-native-purchases --save下载了库,没有做任何附加的iOS设置了概述的文档。我为这件事发疯了,所以我们很感谢你的帮助。
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest"
},
"dependencies": {
"@react-native-community/datetimepicker": "4.0.0",
"@react-native-community/slider": "4.1.12",
"@react-navigation/bottom-tabs": "^6.2.0",
"@react-navigation/native-stack": "^6.4.0",
"dotenv": "^16.0.0",
"expo": "~44.0.0",
"expo-av": "~10.2.0",
"expo-linear-gradient": "~11.0.3",
"expo-status-bar": "~1.2.0",
"firebase": "^9.6.5",
"jest": "26.6.3",
"jest-expo": "^44.0.1",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-circular-progress": "^1.3.7",
"react-native-countdown-circle-timer": "^3.0.9",
"react-native-modal": "^13.0.1",
"react-native-purchases": "^4.6.0",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-web": "0.17.1",
"uuid": "^3.4.0",
"victory-native": "^36.3.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/jest": "^27.4.0",
"@types/react": "~17.0.21",
"@types/react-native": "~0.64.12",
"react-test-renderer": "^17.0.2",
"typescript": "~4.3.5"
},
"jest": {
"preset": "jest-expo",
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
]
},
"private": true
}发布于 2022-06-29 05:28:48
当在expo应用程序上调试时,尝试使用本机模块时会出现此错误消息。模块应该在独立应用程序中工作。
您可以在这里找到使用本机模块进行调试的其他方法-- https://docs.expo.dev/build/internal-distribution/。
https://stackoverflow.com/questions/72772786
复制相似问题