代码之家  ›  专栏  ›  技术社区  ›  Rodrigo

如何在Android上使用应用程序运行react native(使用crna)

  •  0
  • Rodrigo  · 技术社区  · 7 年前

    我有一个简单的应用程序,它是使用CRNA创建的,在iOS上运行良好,但在Android上失败。

    enter image description here

    这似乎与Android操作系统上丢失的JSC有关。我添加了“android jsc”( https://github.com/facebook/android-jsc )DEP到项目,但没有改变。我错过了什么?

    这是我的 package.json

    {
      "name": "app",
      "version": "0.1.0",
      "private": true,
      "devDependencies": {
        "babel-plugin-module-resolver": "^2.7.1",
        "eslint": "^4.10.0",
        "eslint-plugin-react": "^7.4.0",
        "jest-expo": "^28.0.0",
        "jest-immutable-matchers": "^2.0.1",
        "react-native-scripts": "1.14.0",
        "react-test-renderer": "16.4.0"
      },
      "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
      "scripts": {
        "start": "REACT_NATIVE_ENV=development react-native-scripts start",
        "eject": "react-native-scripts eject",
        "android": "react-native-scripts android",
        "ios": "react-native-scripts ios",
        "test": "REACT_NATIVE_ENV=test node node_modules/jest/bin/jest.js --watch",
        "test_ci": "REACT_NATIVE_ENV=test node node_modules/jest/bin/jest.js"
      },
      "jest": {
        "preset": "jest-expo"
      },
      "dependencies": {
        "jsc-android": "224109.x.x",
        "expo": "^29.0.0",
        "immutable": "^3.8.2",
        "momentjs": "^2.0.0",
        "prop-types": "^15.6.1",
        "react": "16.3.1",
        "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
        "react-native-elements": "1.0.0-beta5",
        "react-native-keyboard-aware-scroll-view": "^0.4.1",
        "react-native-modal-datetime-picker": "^6.0.0",
        "react-native-side-menu": "^1.1.3",
        "react-native-vector-icons": "^4.6.0",
        "react-navigation": "2.0.4",
        "react-redux": "^5.0.7",
        "redux": "^4.0.0",
        "redux-immutablejs": "^0.0.8",
        "redux-logger": "^3.0.6",
        "redux-thunk": "^2.2.0",
        "sentry-expo": "^1.9.0",
        "validate": "^4.4.1"
      }
    }
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Filipe    7 年前

    jsc-android 需要手动链接,与世博会不兼容。看看您的所有依赖项是否与Expo兼容。如果没有,你要么分离到expokit,要么寻找一个兼容的替代品。

    编辑:检查后,您将直接安装react本机矢量图标。它需要手动链接,但包含在世博会上。检查 here 以获取说明。

    推荐文章