skip to Main Content

I tried to implement a way to track the position of the users phone. Therefore, I installed expo-location. After installing it with npm i expo-location, I got the following error:

Error: Exception in HostFunction: expected 0 arguments, got 1, js engine: hermes
ERROR Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn’t called., js engine: hermes

Since it was just a test to see how ‘good’ expo-location is working I decided to uninstall it again with npm uninstall expo-location. Unfortunately, it did not remove the error.

Here is my package.json:

{
  "name": "test",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "start-dev": "APP_VARIANT=development expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/hooks": "^2.8.1",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "9.3.10",
    "@react-navigation/bottom-tabs": "^6.4.1",
    "@react-navigation/compat": "^5.3.20",
    "@react-navigation/core": "github:react-navigation/core",
    "@react-navigation/elements": "^1.3.18",
    "@react-navigation/native": "^6.1.14",
    "@react-navigation/stack": "^6.3.20",
    "@rneui/base": "^4.0.0-rc.8",
    "@rneui/themed": "^4.0.0-rc.8",
    "ansi-escapes": "^6.2.0",
    "axios": "^1.2.1",
    "bcryptjs": "^2.4.3",
    "color": "^4.2.3",
    "dayjs": "^1.11.9",
    "dotenv": "^16.3.1",
    "expo": "^49.0.0",
    "expo-constants": "~14.4.2",
    "expo-dev-client": "^2.4.12",
    "expo-device": "~5.4.0",
    "expo-image-manipulator": "~11.3.0",
    "expo-image-picker": "~14.3.2",
    "expo-notifications": "~0.20.1",
    "expo-status-bar": "~1.6.0",
    "expo-updates": "~0.18.18",
    "formik": "^2.2.9",
    "isaac": "^0.0.5",
    "mobx": "^6.7.0",
    "mobx-persist": "^0.4.1",
    "rc": "^1.2.8",
    "react": "18.2.0",
    "react-native": "0.72.6",
    "react-native-alert-notification": "^0.3.5",
    "react-native-check-box": "^2.1.7",
    "react-native-crypto-js": "^1.0.0",
    "react-native-dropdown-picker": "^5.4.4",
    "react-native-element-dropdown": "^2.7.0",
    "react-native-elements": "^3.4.3",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-gifted-chat": "^2.4.0",
    "react-native-loading-modal": "^1.1.0",
    "react-native-material-dropdown": "^0.11.1",
    "react-native-reanimated": "^3.6.1",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-tabs": "^1.0.9",
    "react-native-web": "~0.19.6",
    "react-navigation": "^4.4.4",
    "react-navigation-stack": "^2.10.4",
    "react-navigation-tabs": "^2.11.2",
    "socket.io-client": "^4.7.2",
    "uuid": "^3.4.0",
    "ws": "^8.15.0",
    "yup": "^0.32.11"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "reactotron-react-js": "^3.3.8"
  },
  "private": true
}

I have already tried to remove package-lock.json and reinstall the whole sh*t, but nothing gets my project to work. I’m looking forward to helpful advice.

2

Answers


  1. For me, it was my React Native Reanimated that was causing the issue, so all you have to do is uninstall and then reinstall the React Native Reanimated and then clear your cache when starting the app.

    Login or Signup to reply.
  2. You are using "expo": "^49.0.0". Latest version "50.0.12" .
    Do you make npm install [email protected] –save
    After
    npx expo start -c

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search