当使用反应现代购买时,本机模块不能为null

发布于 2025-02-10 22:59:31 字数 2076 浏览 2 评论 0原文

试图运行带有收入猫整合的本地项目的Expo React项目。每当我下载了React-native-pruchase库时,我都会继续遇到此错误。

不变违规:本机模块不能为null

我通过运行npm install intern react-native-quarchases-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
}


Trying to run an expo react native project w/ revenue cat integration. Whenever I had the react-native-pruchases library downloaded though, I continue to get this error.

Invariant Violation: Native module cannot be null

I downloaded the library by running npm install react-native-purchases --save, I didn't do any of the additional iOS setup the docs outlined. I've been going crazy over this so some help is appreciated.

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
}


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

々眼睛长脚气 2025-02-17 22:59:31

在Expo Go应用程序上调试时,尝试使用本机模块时会发生此错误消息。该模块应在独立应用程序中使用。

您可以在此处找到其他与本机模块进行调试的方法/构建/内部分布/

This error message occurs when trying to use a native module when debugging on the expo go app. The module should work in the standalone app.

You can find other ways to debug with the native modules here https://docs.expo.dev/build/internal-distribution/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文