0

I have this a simple app which was created using CRNA which runs fine on iOS but fails on Android.

enter image description here

It seems to be related to the missing JSC on Android OS. I added the "android-jsc" (https://github.com/facebook/android-jsc) dep to the project but nothing changed. What am I missing?

Here is my 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"
  }
}
Rodrigo
  • 5,435
  • 5
  • 42
  • 78

1 Answers1

1

jsc-android needs manual linking, and isn't compatible with Expo. See if all your dependencies are compatible with Expo. If not, you'll either have to detach to ExpoKit, or look for a compatible substitute.

Edit: Upon inspection, you are installing react-native-vector-icons directly. It needs manual linking, but is included on Expo. Check here for the instructions.

Filipe
  • 866
  • 5
  • 16
  • Ok, found it. It is this lib: https://github.com/eivindfjeldstad/validate. It fails in this line https://github.com/eivindfjeldstad/validate/blob/master/src/property.js#L38. Would you know if is it possible to add some present to babel to transpile it to a JS that runs on Android? – Rodrigo Aug 20 '18 at 18:28
  • That's strange. The problem with Expo is with libraries that use native code, thus requiring to change some android/iOS files, which Expo doesn't allow. The other problem with js libraries is if they use some API that is only available on web, failing on native. But this library doesn't seem to do so, and looking through the issues, seems someone has already managed to get it working on RN. – Filipe Aug 21 '18 at 11:57
  • 1
    Looks like the JS code shipped with expo (or CRNA code) doesn't support the syntax `let for of`. I fixed the issue adding the dependency `es6-symbol` and requiring it in the app entrypoint. https://github.com/facebook/react-native/issues/15902. (Just another day struggling with the JS world syntax hell) – Rodrigo Aug 21 '18 at 13:21
  • That's really strange! I just checked the documentation for the supported properties [here](https://facebook.github.io/react-native/docs/0.55/javascript-environment#docsNav), and it is supposed to be supported. Nevertheless, I'm happy you found a solution. – Filipe Aug 21 '18 at 17:42